Add unit tests for pluralize
This commit is contained in:
17
extensions/ql-vscode/test/pure-tests/word.test.ts
Normal file
17
extensions/ql-vscode/test/pure-tests/word.test.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { expect } from 'chai';
|
||||
|
||||
import { pluralize } from '../../src/pure/word';
|
||||
|
||||
describe('word helpers', () => {
|
||||
describe('pluralize', () => {
|
||||
it('should return the plural form if the number is 0', () => {
|
||||
expect(pluralize(0, 'thing', 'things')).to.eq('0 things');
|
||||
});
|
||||
it('should return the singular form if the number is 1', () => {
|
||||
expect(pluralize(1, 'thing', 'things')).to.eq('1 thing');
|
||||
});
|
||||
it('should return the plural form if the number is greater than 1', () => {
|
||||
expect(pluralize(7, 'thing', 'things')).to.eq('7 things');
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user