-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathreverse-string.spec.js
More file actions
33 lines (28 loc) · 856 Bytes
/
Copy pathreverse-string.spec.js
File metadata and controls
33 lines (28 loc) · 856 Bytes
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 { reverseString } from './reverse-string';
describe('ReverseString', () => {
test('empty string', () => {
const expected = '';
const actual = reverseString('');
expect(actual).toEqual(expected);
});
test('a word', () => {
const expected = 'tobor';
const actual = reverseString('robot');
expect(actual).toEqual(expected);
});
test('a capitalized word', () => {
const expected = 'nemaR';
const actual = reverseString('Ramen');
expect(actual).toEqual(expected);
});
test('a sentence with punctuation', () => {
const expected = '!yrgnuh ma I';
const actual = reverseString('I am hungry!');
expect(actual).toEqual(expected);
});
test('a palindrome', () => {
const expected = 'racecar';
const actual = reverseString('racecar');
expect(actual).toEqual(expected);
});
});