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.
27 lines
708 B
JavaScript
27 lines
708 B
JavaScript
'use strict'
|
|
|
|
const { test, given, forCases } = require('sazerac')
|
|
const {
|
|
renderDependenciesBadge,
|
|
} = require('./librariesio-dependencies-helpers')
|
|
|
|
describe('Libraries.io dependency helpers', function() {
|
|
test(renderDependenciesBadge, () => {
|
|
forCases([
|
|
given({ deprecatedCount: 10, outdatedCount: 0 }),
|
|
given({ deprecatedCount: 10, outdatedCount: 5 }),
|
|
]).expect({
|
|
message: '10 deprecated',
|
|
color: 'red',
|
|
})
|
|
given({ deprecatedCount: 0, outdatedCount: 5 }).expect({
|
|
message: '5 out of date',
|
|
color: 'orange',
|
|
})
|
|
given({ deprecatedCount: 0, outdatedCount: 0 }).expect({
|
|
message: 'up to date',
|
|
color: 'brightgreen',
|
|
})
|
|
})
|
|
})
|