Files
30-seconds-of-code/test5/pluralize/pluralize.test.js
Angelos Chalaris 5afe81452a Migrated tests to jest
Used jest-codemods to migrate, will have to pass everything by hand before we can merge.
2018-06-18 14:18:25 +03:00

19 lines
652 B
JavaScript

const expect = require('expect');
const pluralize = require('./pluralize.js');
test('Testing pluralize', () => {
//For more information on all the methods supported by tape
//Please go to https://github.com/substack/tape
expect(typeof pluralize === 'function').toBeTruthy();
expect(pluralize(0, 'apple')).toBe('apples');
expect(pluralize(1, 'apple')).toBe('apple');
expect(pluralize(2, 'apple')).toBe('apples');
expect(pluralize(2, 'person', 'people')).toBe('people');
const PLURALS = {
person: 'people',
radius: 'radii'
};
const autoPluralize = pluralize(PLURALS);
expect(autoPluralize(2, 'person')).toBe('people');
});