| Total Complexity | 8 |
| Complexity/F | 1 |
| Lines of Code | 37 |
| Function Count | 8 |
| Duplicated Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | const { |
||
| 2 | palindrome, |
||
| 3 | palindrome2 |
||
| 4 | } = require('./index.js'); |
||
| 5 | |||
| 6 | test('test palindrome with empty', () => { |
||
| 7 | expect(palindrome('')).toEqual(true); |
||
| 8 | }); |
||
| 9 | |||
| 10 | test('test palindrome with string contain only one character', () => { |
||
| 11 | expect(palindrome('abba')).toEqual(true); |
||
| 12 | }); |
||
| 13 | |||
| 14 | test('test palindrome with abba', () => { |
||
| 15 | expect(palindrome('abba')).toEqual(true); |
||
| 16 | }); |
||
| 17 | |||
| 18 | test('test palindrome with abc', () => { |
||
| 19 | expect(palindrome('abc')).toEqual(false); |
||
| 20 | }); |
||
| 21 | |||
| 22 | // test solution2 |
||
| 23 | test('test palindrome2 with empty', () => { |
||
| 24 | expect(palindrome2('')).toEqual(true); |
||
| 25 | }); |
||
| 26 | |||
| 27 | test('test palindrome2 with string contain only one character', () => { |
||
| 28 | expect(palindrome2('abba')).toEqual(true); |
||
| 29 | }); |
||
| 30 | |||
| 31 | test('test palindrome2 with abba', () => { |
||
| 32 | expect(palindrome2('abba')).toEqual(true); |
||
| 33 | }); |
||
| 34 | |||
| 35 | test('test palindrome2 with abc', () => { |
||
| 36 | expect(palindrome2('abc')).toEqual(false); |
||
| 37 | }); |