This takes another pass over the modern services to remove unused code. I switched the shared code to use a function instead of a class and removed the indirection in the route params which led to skew between the route and examples and wasn't making things any clearer.
20 lines
452 B
JavaScript
20 lines
452 B
JavaScript
'use strict'
|
|
|
|
const { isMetric } = require('../test-validators')
|
|
const t = (module.exports = require('../tester').createServiceTester())
|
|
|
|
t.create('dependent count')
|
|
.get('/npm/got.json')
|
|
.expectBadge({
|
|
label: 'dependents',
|
|
message: isMetric,
|
|
})
|
|
|
|
t.create('dependent count (nonexistent package)')
|
|
.get('/npm/foobar-is-not-package.json')
|
|
.timeout(10000)
|
|
.expectBadge({
|
|
label: 'dependents',
|
|
message: 'package not found',
|
|
})
|