We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
twinPrime
1 parent 4a4ed57 commit 4474922Copy full SHA for 4474922
Maths/test/TwinPrime.test.js
@@ -1,10 +1,13 @@
1
import { twinPrime } from '../TwinPrime.js'
2
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)
+describe('twinPrime', () => {
+ it.each([
+ [3, 5],
+ [5, 7],
+ [7, -1],
+ [4, -1],
9
+ [17, 19]
10
+ ])('for input %i returns %i', (n, expected) => {
11
+ expect(twinPrime(n)).toBe(expected)
12
})
13
0 commit comments