forked from exercism/javascript
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathreverse-string.spec.js
More file actions
58 lines (49 loc) · 1.64 KB
/
Copy pathreverse-string.spec.js
File metadata and controls
58 lines (49 loc) · 1.64 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import { describe, expect, test, xtest } from '@jest/globals';
import { reverseString } from './reverse-string';
describe('ReverseString', () => {
test('empty string', () => {
const expected = '';
const actual = reverseString('');
expect(actual).toEqual(expected);
});
xtest('a word', () => {
const expected = 'tobor';
const actual = reverseString('robot');
expect(actual).toEqual(expected);
});
xtest('a capitalized word', () => {
const expected = 'nemaR';
const actual = reverseString('Ramen');
expect(actual).toEqual(expected);
});
xtest('a sentence with punctuation', () => {
const expected = '!yrgnuh ma I';
const actual = reverseString('I am hungry!');
expect(actual).toEqual(expected);
});
xtest('a palindrome', () => {
const expected = 'racecar';
const actual = reverseString('racecar');
expect(actual).toEqual(expected);
});
xtest('an even-sized word', () => {
const expected = 'reward';
const actual = reverseString('drawer');
expect(actual).toEqual(expected);
});
xtest('wide characters', () => {
const expected = '猫子';
const actual = reverseString('子猫');
expect(actual).toEqual(expected);
});
test.skip('grapheme cluster with pre-combined form', () => {
const expected = 'dnatsnehctsrüW';
const actual = reverseString('Würstchenstand');
expect(actual).toEqual(expected);
});
test.skip('grapheme clusters', () => {
const expected = 'มรกแรปโนยขีเผู้';
const actual = reverseString('ผู้เขียนโปรแกรม');
expect(actual).toEqual(expected);
});
});