Test cleanup and fixes [o-p]

This commit is contained in:
Angelos Chalaris
2018-06-18 18:00:19 +03:00
parent b393ad5878
commit 43e92c610d
35 changed files with 164 additions and 262 deletions

View File

@ -1,29 +1,26 @@
const expect = require('expect');
const pluralize = require('./pluralize.js');
test('pluralize is a Function', () => {
test('pluralize is a Function', () => {
expect(pluralize).toBeInstanceOf(Function);
});
test('Produces the plural of the word', () => {
expect(pluralize(0, 'apple'), 'apples').toBe()
test('Produces the plural of the word', () => {
expect(pluralize(0, 'apple')).toBe('apples');
});
test('Produces the singular of the word', () => {
expect(pluralize(1, 'apple'), 'apple').toBe()
test('Produces the singular of the word', () => {
expect(pluralize(1, 'apple')).toBe('apple');
});
test('Produces the plural of the word', () => {
expect(pluralize(2, 'apple'), 'apples').toBe()
test('Produces the plural of the word', () => {
expect(pluralize(2, 'apple')).toBe('apples');
});
test('Prodices the defined plural of the word', () => {
expect(pluralize(2, 'person', 'people'), 'people').toBe()
test('Prodices the defined plural of the word', () => {
expect(pluralize(2, 'person', 'people')).toBe('people');
});
const PLURALS = {
person: 'people',
radius: 'radii'
};
const autoPluralize = pluralize(PLURALS);
test('Works with a dictionary', () => {
expect(autoPluralize(2, 'person'), 'people').toBe()
const PLURALS = {
person: 'people',
radius: 'radii'
};
const autoPluralize = pluralize(PLURALS);
test('Works with a dictionary', () => {
expect(autoPluralize(2, 'person')).toBe('people');
});