-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcrawl.test.js
More file actions
25 lines (20 loc) · 890 Bytes
/
crawl.test.js
File metadata and controls
25 lines (20 loc) · 890 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
const { test, expect } = require("@jest/globals")
const { normalizeUrl } = require('./crawl.js')
test('http-url-to-normalized', () => {
expect(normalizeUrl('http://blog.boot.dev/path/')).toBe('blog.boot.dev/path')
})
test('http-url-slash-to-normalized', () => {
expect(normalizeUrl('http://blog.boot.dev/path/')).toBe('blog.boot.dev/path')
})
test('http-url-query-params-to-normalized', () => {
expect(normalizeUrl('http://blog.boot.dev/path?var=value')).toBe('blog.boot.dev/path')
})
test('https-url-to-normalized', () => {
expect(normalizeUrl('https://blog.boot.dev/path/')).toBe('blog.boot.dev/path')
})
test('https-url-slash-to-normalized', () => {
expect(normalizeUrl('https://blog.boot.dev/path/')).toBe('blog.boot.dev/path')
})
test('https-url-query-params-to-normalized', () => {
expect(normalizeUrl('https://blog.boot.dev/path?var=value')).toBe('blog.boot.dev/path')
})