Files
shields/services/librariesio/librariesio-dependencies-helpers.spec.js
Paul Melnikow 946abc9ded Refactor [librariesio] (#3160)
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.
2019-03-06 23:21:22 -05:00

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',
})
})
})