-
Notifications
You must be signed in to change notification settings - Fork 0
/
int_to_words.test.js
78 lines (58 loc) · 2.54 KB
/
int_to_words.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
const num_to_words = require('./int_to_words');
test('Should convert decimal 1 to One', () => {
expect(num_to_words(1)).toBe(`One`);
});
test('Should convert decimal 2 to Two', () => {
expect(num_to_words(2)).toBe(`Two`);
});
test('Should convert decimal 3 to Three', () => {
expect(num_to_words(3)).toBe(`Three`);
});
test('Should convert decimal 20 to Twenty', () => {
expect(num_to_words(20)).toBe(`Twenty`);
});
test('Should convert decimal 21 to Twenty One', () => {
expect(num_to_words(21)).toBe(`Twenty One`);
});
test('Should convert decimal 30 to Thirty', () => {
expect(num_to_words(30)).toBe(`Thirty`);
});
test('Should convert decimal 100 to One Hundred', () => {
expect(num_to_words(100)).toBe(`One Hundred`);
});
test('Should convert decimal 101 to One Hundred and One', () => {
expect(num_to_words(101)).toBe(`One Hundred and One`);
});
test('Should convert decimal 200 to Two Hundred', () => {
expect(num_to_words(200)).toBe(`Two Hundred`);
});
test('Should convert decimal 999 to Nine Hundred and Ninety Nine', () => {
expect(num_to_words(999)).toBe(`Nine Hundred and Ninety Nine`);
});
test('Should convert decimal 1000 to One Thousand', () => {
expect(num_to_words(1000)).toBe(`One Thousand`);
});
test('Should convert decimal 1001 to One Thousand and One', () => {
expect(num_to_words(1001)).toBe(`One Thousand and One`);
});
test('Should convert decimal 10456 to Ten Thousand Four Hundred and Fifty Six', () => {
expect(num_to_words(10456)).toBe(`Ten Thousand Four Hundred and Fifty Six`);
});
test('Should convert decimal 100000 to One Hundred Thousand', () => {
expect(num_to_words(100000)).toBe(`One Hundred Thousand`);
});
test('Should convert decimal 100849 to One Hundred Thousand Eight Hundred and Forty Nine', () => {
expect(num_to_words(100849)).toBe(`One Hundred Thousand Eight Hundred and Forty Nine`);
});
test('Should convert decimal 987654 to Nine Hundred and Eighty Seven Thousand Six Hundred and Fifty Four', () => {
expect(num_to_words(987654)).toBe(`Nine Hundred and Eighty Seven Thousand Six Hundred and Fifty Four`);
});
test('Should convert decimal 1000000 to One Million', () => {
expect(num_to_words(1000000)).toBe(`One Million`);
});
test('Should convert decimal 1000001 to One Million and One', () => {
expect(num_to_words(1000001)).toBe(`One Million and One`);
});
test('Should convert decimal 1760001 to One Million Seven Hundred and Sixty Thousand and One', () => {
expect(num_to_words(1760001)).toBe(`One Million Seven Hundred and Sixty Thousand and One`);
});