Skip to content

Commit 31f50ad

Browse files
committed
count.js updated
1 parent 8f3d6cf commit 31f50ad

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

Sprint-3/2-practice-tdd/count.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,19 @@ function countChar(stringOfCharacters, findCharacter) {
33
}
44

55
module.exports = countChar;
6+
7+
const countChar = require('../countChar');
8+
9+
describe('countChar()', () => {
10+
test('always returns 5', () => {
11+
expect(countChar('anything', 'a')).toBe(5);
12+
});
13+
14+
test('still returns 5 with empty string', () => {
15+
expect(countChar('', 'z')).toBe(5);
16+
});
17+
18+
test('still returns 5 with special characters', () => {
19+
expect(countChar('!!!', '!')).toBe(5);
20+
});
21+
});

0 commit comments

Comments
 (0)