Files
shields/lib/text-formatters.spec.js
Paul Melnikow 820b72c4c4 Always allow overriding the label (#1108)
Audit all the badges with test coverage, looking for badges which assign `badgeData.text[0]`.
2017-10-01 20:20:13 -04:00

21 lines
695 B
JavaScript

'use strict';
const assert = require('assert');
const {
maybePluralize
} = require('./text-formatters');
describe('text formatters', function() {
it('should pluralize', function() {
assert.equal(maybePluralize('foo', []), 'foos');
assert.equal(maybePluralize('foo', [123]), 'foo');
assert.equal(maybePluralize('foo', [123, 456]), 'foos');
assert.equal(maybePluralize('foo', undefined), 'foos');
assert.equal(maybePluralize('box', [], 'boxes'), 'boxes');
assert.equal(maybePluralize('box', [123], 'boxes'), 'box');
assert.equal(maybePluralize('box', [123, 456], 'boxes'), 'boxes');
assert.equal(maybePluralize('box', undefined, 'boxes'), 'boxes');
});
});