-
Notifications
You must be signed in to change notification settings - Fork 1
/
hours.test.js
41 lines (32 loc) · 858 Bytes
/
hours.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
37
38
39
40
41
const {
GetClockwork
} = require('./clockwork');
const testClock = GetClockwork('en');
test('high noon', () => {
const time = '12:00';
const expected = [
"it", "is", "twelve", "o'clock"
];
expect(testClock.timeWords(time)).toStrictEqual(expected);
});
test('another hour', () => {
const time = '10:00';
const expected = [
"it", "is", "ten", "o'clock"
];
expect(testClock.timeWords(time)).toStrictEqual(expected);
});
test('midnight', () => {
const time = '00:00';
const expected = [
"it", "is", "twelve", "o'clock"
];
expect(testClock.timeWords(time)).toStrictEqual(expected);
});
test('handle PM times', () => {
const time = '22:00';
const expected = [
"it", "is", "ten", "o'clock"
];
expect(testClock.timeWords(time)).toStrictEqual(expected);
});