Skip to content

Commit f95b39c

Browse files
committed
feat: add some basic test suites (Mao)
1 parent d6b751c commit f95b39c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

15_totalIntegers/solution/totalIntegers-solution.spec.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
const totalIntegers = require('./totalIntegers-solution');
22

33
describe('totalIntegers', () => {
4+
test('Works with a simple array of numbers', () => {
5+
expect(totalIntegers([1, 2, 3])).toBe(3);
6+
});
7+
test('Ignores non-integer values', () => {
8+
expect(totalIntegers([1, 2, '3', 4])).toBe(3);
9+
});
10+
test('Works with simple objects', () => {
11+
expect(totalIntegers({ a: 1, b: '2', c: 3 })).toBe(2);
12+
});
413
test('Works with an empty nested array', () => {
514
expect(totalIntegers([[], [], []])).toBe(0);
615
});

0 commit comments

Comments
 (0)