-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsolution.spec.js
33 lines (30 loc) · 1.05 KB
/
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
import { checkPart } from './solution';
describe('Challenge 08: We need a mechanic!', () => {
describe('checkPart(...)', () => {
const testCases = [
createTestCase(['uwu'], true, 'should return true if the string is a palindrome'),
createTestCase(['midu'], false, 'should return false if the string is not a palindrome'),
createTestCase(
['lolol'],
true,
'should return true if the string can be a palindrome by removing one character (1)'
),
createTestCase(
['yolooloy'],
true,
'should return true if the string can be a palindrome by removing one character (2)'
),
createTestCase(
['zzzoonzzz'],
true,
'should return true if the string can be a palindrome by removing one character (3)'
)
];
it('#T should return a boolean', () => {
expect(typeof checkPart('asdf')).toBe('boolean');
});
it.each(testCases)('#$# $description', ({ args, expected }) => {
expect(checkPart(...args)).toEqual(expected);
});
});
});