Skip to content

Commit 436af06

Browse files
committed
Add unit tests for pluralize
1 parent c85338d commit 436af06

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { expect } from 'chai';
2+
3+
import { pluralize } from '../../src/pure/word';
4+
5+
describe('word helpers', () => {
6+
describe('pluralize', () => {
7+
it('should return the plural form if the number is 0', () => {
8+
expect(pluralize(0, 'thing', 'things')).to.eq('0 things');
9+
});
10+
it('should return the singular form if the number is 1', () => {
11+
expect(pluralize(1, 'thing', 'things')).to.eq('1 thing');
12+
});
13+
it('should return the plural form if the number is greater than 1', () => {
14+
expect(pluralize(7, 'thing', 'things')).to.eq('7 things');
15+
});
16+
});
17+
});

0 commit comments

Comments
 (0)