-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.test.js
48 lines (43 loc) · 1.59 KB
/
index.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
const getFilesToBackup = require('./index.js')
describe('Challenge 13', () => {
test("Test #01 - expect return type array", () => {
expect(typeof getFilesToBackup(0, [0, 0])).toBe('object')
})
test("Test #02 - expect getFilesToBackup(1546300800, [[ 1, 1546300800 ],[ 2, 1546300800 ],[ 1, 1546300900 ],[ 1, 1546301000 ],[ 3, 1546301100 ]]) to be [1,3]", () => {
expect(getFilesToBackup(1546300800, [
[1, 1546300800],
[2, 1546300800],
[1, 1546300900],
[1, 1546301000],
[3, 1546301100]
])).toEqual([
1,
3
])
})
test("Test #03 - expect getFilesToBackup(1546300600, [[ 1, 1546300800 ],[ 2, 1546300800 ],[ 1, 1546300900 ],[ 1, 1546301000 ],[ 3, 1546301100 ]]) to be [1,2,3]", () => {
expect(getFilesToBackup(1546300600, [
[1, 1546300800],
[2, 1546300800],
[1, 1546300900],
[1, 1546301000],
[3, 1546301100]
])).toEqual([
1,
2,
3
])
})
test("Test #04 - expect getFilesToBackup(1556300600, [[ 1, 1546300800 ],[ 2, 1546300800 ],[ 1, 1546300900 ],[ 1, 1546301000 ],[ 3, 1546301100 ]]) to be []", () => {
expect(getFilesToBackup(1556300600, [
[1, 1546300800],
[2, 1546300800],
[1, 1546300900],
[1, 1546301000],
[3, 1546301100]
])).toEqual([])
})
test("Test #04 - expect getFilesToBackup(1556300600, []) to be []", () => {
expect(getFilesToBackup(1556300600, [])).toEqual([])
})
})