We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
pluralize
1 parent c85338d commit 436af06Copy full SHA for 436af06
extensions/ql-vscode/test/pure-tests/word.test.ts
@@ -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