-
Notifications
You must be signed in to change notification settings - Fork 12
/
index.test.js
36 lines (31 loc) · 1.07 KB
/
index.test.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
35
36
import {displayPerfTime} from '../../utils/perf-utils';
import {isPalindrome} from '.';
describe('isPalindrome', () => {
it('should spot the palindrome right', () => {
expect(isPalindrome("Madam, I'm Adam")).toBeTruthy();
});
it('should spot the palindrome right', () => {
expect(
isPalindrome(
"T. Eliot, top bard, notes putrid tang emanating, is sad; I'd assign it a name: gnat dirt upset on drab pot toilet."
)
).toBeTruthy();
});
it('should spot a not-palindrome', () => {
expect(isPalindrome("Madam, I'm Larry")).toBeFalsy();
});
describe('Performance', () => {
it('will display perftime', () => {
displayPerfTime('isPalindrome("Madam, I\'m Adam")', () => {
isPalindrome("Madam, I'm Adam");
});
});
it('will display perftime with another palindrome', () => {
displayPerfTime('isPalindrome("long one")', () => {
isPalindrome(
"T. Eliot, top bard, notes putrid tang emanating, is sad; I'd assign it a name: gnat dirt upset on drab pot toilet."
);
});
});
});
});