Tests for pluralize

This commit is contained in:
Angelos Chalaris
2018-02-04 20:57:14 +02:00
parent 48c112d92b
commit b19c621cad
2 changed files with 19 additions and 4 deletions

View File

@ -5,6 +5,16 @@ test('Testing pluralize', (t) => {
//For more information on all the methods supported by tape
//Please go to https://github.com/substack/tape
t.true(typeof pluralize === 'function', 'pluralize is a Function');
t.equal(pluralize(0, 'apple'), 'apples', 'Produces the plural of the word');
t.equal(pluralize(1, 'apple'), 'apple', 'Produces the singular of the word');
t.equal(pluralize(2, 'apple'), 'apples', 'Produces the plural of the word');
t.equal(pluralize(2, 'person', 'people'), 'people', 'Prodices the defined plural of the word');
const PLURALS = {
person: 'people',
radius: 'radii'
};
const autoPluralize = pluralize(PLURALS);
t.equal(autoPluralize(2, 'person'), 'people', 'Works with a dictionary');
//t.deepEqual(pluralize(args..), 'Expected');
//t.equal(pluralize(args..), 'Expected');
//t.false(pluralize(args..), 'Expected');

View File

@ -1,4 +1,4 @@
Test log for: Sun Feb 04 2018 20:53:05 GMT+0200 (GTB Standard Time)
Test log for: Sun Feb 04 2018 20:56:18 GMT+0200 (GTB Standard Time)
> 30-seconds-of-code@0.0.1 test G:\My Files\git Repositories\30-seconds-of-code
> tape test/**/*.test.js | tap-spec
@ -1114,6 +1114,11 @@ Test log for: Sun Feb 04 2018 20:53:05 GMT+0200 (GTB Standard Time)
Testing pluralize
√ pluralize is a Function
√ Produces the plural of the word
√ Produces the singular of the word
√ Produces the plural of the word
√ Prodices the defined plural of the word
√ Works with a dictionary
Testing powerset
@ -1713,8 +1718,8 @@ Test log for: Sun Feb 04 2018 20:53:05 GMT+0200 (GTB Standard Time)
√ Works with multiple promises
total: 820
passing: 820
total: 825
passing: 825
duration: 2.4s