Skip to content

Commit 4474922

Browse files
committed
tests: add missing test of twinPrime
1 parent 4a4ed57 commit 4474922

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

Maths/test/TwinPrime.test.js

+9-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
import { twinPrime } from '../TwinPrime.js'
22

3-
describe('Twin Primes', () => {
4-
it('Should be valid twin primes', () => {
5-
expect(twinPrime(3)).toBe(5)
6-
expect(twinPrime(5)).toBe(7)
7-
expect(twinPrime(4)).toBe(-1)
8-
expect(twinPrime(17)).toBe(19)
3+
describe('twinPrime', () => {
4+
it.each([
5+
[3, 5],
6+
[5, 7],
7+
[7, -1],
8+
[4, -1],
9+
[17, 19]
10+
])('for input %i returns %i', (n, expected) => {
11+
expect(twinPrime(n)).toBe(expected)
912
})
1013
})

0 commit comments

Comments
 (0)