-
Notifications
You must be signed in to change notification settings - Fork 1
/
minutes.test.js
86 lines (67 loc) · 1.95 KB
/
minutes.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
const {
GetClockwork
} = require('./clockwork');
const testClock = GetClockwork('en');
test('five past the hour', () => {
const time = '12:05';
const expected = [
"it", "is", "five", "minutes", "past", "twelve"
];
expect(testClock.timeWords(time)).toStrictEqual(expected);
});
test('twenty past the hour', () => {
const time = '12:20';
const expected = [
"it", "is", "twenty", "minutes", "past", "twelve"
];
expect(testClock.timeWords(time)).toStrictEqual(expected);
});
test('round minutes down', () => {
const time = '12:06';
const expected = [
"it", "is", "five", "minutes", "past", "twelve"
];
expect(testClock.timeWords(time)).toStrictEqual(expected);
});
test('quarter past the hour', () => {
const time = '12:15';
const expected = [
"it", "is", "quarter", "past", "twelve"
];
expect(testClock.timeWords(time)).toStrictEqual(expected);
});
test('half past the hour', () => {
const time = '12:30';
const expected = [
"it", "is", "half", "past", "twelve"
];
expect(testClock.timeWords(time)).toStrictEqual(expected);
});
test('twenty-five past the hour', () => {
const time = '12:25';
const expected = [
"it", "is", "twenty", "five", "minutes", "past", "twelve"
];
expect(testClock.timeWords(time)).toStrictEqual(expected);
});
test('five to one', () => {
const time = '12:55';
const expected = [
"it", "is", "five", "minutes", "to", "one"
];
expect(testClock.timeWords(time)).toStrictEqual(expected);
});
test('quarter to one', () => {
const time = '12:45';
const expected = [
"it", "is", "quarter", "to", "one"
];
expect(testClock.timeWords(time)).toStrictEqual(expected);
});
test('ten to 12', () => {
const time = '11:52';
const expected = [
"it", "is", "ten", "minutes", "to", "twelve"
];
expect(testClock.timeWords(time)).toStrictEqual(expected);
});