-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreport.test.js
More file actions
37 lines (32 loc) · 976 Bytes
/
report.test.js
File metadata and controls
37 lines (32 loc) · 976 Bytes
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
const { sortPages } = require('./report')
const { test, expect } = require('@jest/globals')
test('sort 2 pages', () => {
const input = {
'https://wagslane.dev': 3,
'https://wagslane.dev/path': 1,
'https://wagslane.dev/path2': 22,
'https://wagslane.dev/path4': 5,
'https://wagslane.dev/path3': 10
}
const actual = sortPages(input)
const expected = [
['https://wagslane.dev/path2', 22],
['https://wagslane.dev/path3', 10],
['https://wagslane.dev/path4', 5],
['https://wagslane.dev', 3],
['https://wagslane.dev/path', 1]
]
expect(actual).toEqual(expected)
})
test('sort 5 pages', () => {
const input = {
'https://wagslane.dev': 3,
'https://wagslane.dev/path': 1
}
const actual = sortPages(input)
const expected = [
['https://wagslane.dev', 3],
['https://wagslane.dev/path', 1]
]
expect(actual).toEqual(expected)
})