| Total Complexity | 7 |
| Complexity/F | 1 |
| Lines of Code | 39 |
| Function Count | 7 |
| Duplicated Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | import { reverseString } from './reverse-string'; |
||
| 2 | |||
| 3 | describe('ReverseString', () => { |
||
| 4 | test('empty string', () => { |
||
| 5 | const expected = ''; |
||
| 6 | const actual = reverseString(''); |
||
| 7 | expect(actual).toEqual(expected); |
||
| 8 | }); |
||
| 9 | |||
| 10 | test('a word', () => { |
||
| 11 | const expected = 'tobor'; |
||
| 12 | const actual = reverseString('robot'); |
||
| 13 | expect(actual).toEqual(expected); |
||
| 14 | }); |
||
| 15 | |||
| 16 | test('a capitalized word', () => { |
||
| 17 | const expected = 'nemaR'; |
||
| 18 | const actual = reverseString('Ramen'); |
||
| 19 | expect(actual).toEqual(expected); |
||
| 20 | }); |
||
| 21 | |||
| 22 | test('a sentence with punctuation', () => { |
||
| 23 | const expected = '!yrgnuh ma I'; |
||
| 24 | const actual = reverseString('I am hungry!'); |
||
| 25 | expect(actual).toEqual(expected); |
||
| 26 | }); |
||
| 27 | |||
| 28 | test('a palindrome', () => { |
||
| 29 | const expected = 'racecar'; |
||
| 30 | const actual = reverseString('racecar'); |
||
| 31 | expect(actual).toEqual(expected); |
||
| 32 | }); |
||
| 33 | |||
| 34 | test('an even-sized word', () => { |
||
| 35 | const expected = 'reward'; |
||
| 36 | const actual = reverseString('drawer'); |
||
| 37 | expect(actual).toEqual(expected); |
||
| 38 | }); |
||
| 39 | }); |
||
| 40 |