-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsolution.spec.js
34 lines (31 loc) · 921 Bytes
/
solution.spec.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import { checkIsValidCopy } from "./solution";
describe("Challenge #12: 📸 Is it a valid copy?", () => {
const testCases = [
createTestCase(
["Santa Claus is coming", "sa#ta cl#us is comin#"],
true,
"should return true for a valid copy"
),
createTestCase(
["Santa Claus is coming", "p#nt: cla#s #s c+min#"],
false,
"should return false for an invalid copy"
),
createTestCase(
["Santa Claus", "s#+:. c:. s"],
true,
"should return true for a valid copy"
),
createTestCase(
["Santa Claus", "s#+:.#c:. s"],
false,
"should return false for an invalid copy"
),
];
it.each(testCases)("#$# $description", ({ input, expected, description }) => {
expect(checkIsValidCopy(...input)).toEqual(expected);
});
});
function createTestCase(input, expected, description) {
return { input, expected, description };
}