-
-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathgeo-from-ip.test.js
82 lines (79 loc) · 2.42 KB
/
geo-from-ip.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
const debug = require('debug')('geo-from-ip:test')
const geo = require('../lib/geo-from-ip.js')
debug('Generating 5 random IPs to run tests upon')
describe(`geo-from-ip`, () => {
describe(`error`, () => {
test(`0`, () => {
const result = geo.allData(`0`)
expect(result).toBeDefined()
expect(result).toMatchSnapshot()
})
test(`0.0.0.0`, () => {
const result = geo.allData(`0.0.0.0`)
expect(result).toBeDefined()
expect(result).toMatchSnapshot()
})
test(`127.0.0.1`, () => {
const result = geo.allData(`127.0.0.1`)
expect(result).toBeDefined()
expect(result).toMatchSnapshot()
})
test(`10.0.0.1`, () => {
const result = geo.allData(`10.0.0.1`)
expect(result).toBeDefined()
expect(result).toMatchSnapshot()
})
test(`172.16.0.1`, () => {
const result = geo.allData(`172.16.0.1`)
expect(result).toBeDefined()
expect(result).toMatchSnapshot()
})
test(`192.168.0.1`, () => {
const result = geo.allData(`192.168.0.1`)
expect(result).toBeDefined()
expect(result).toMatchSnapshot()
})
test(`255.255.255.255`, () => {
const result = geo.allData(`255.255.255.255`)
expect(result).toBeDefined()
expect(result).toMatchSnapshot()
})
})
describe(`allData`, () => {
test(`1.1.1.1`, () => {
const result = geo.allData(`1.1.1.1`)
expect(result).toBeDefined()
expect(result).toMatchSnapshot()
})
test(`8.8.8.8`, () => {
const result = geo.allData(`8.8.8.8`)
expect(result).toBeDefined()
expect(result).toMatchSnapshot()
})
test(`18.12.25.208`, () => {
const result = geo.allData(`18.12.25.208`)
expect(result).toBeDefined()
expect(result).toMatchSnapshot()
})
test(`53.251.2.108`, () => {
const result = geo.allData(`53.251.2.108`)
expect(result).toBeDefined()
expect(result).toMatchSnapshot()
})
test(`95.84.136.77`, () => {
const result = geo.allData(`95.84.136.77`)
expect(result).toBeDefined()
expect(result).toMatchSnapshot()
})
test(`199.188.195.120`, () => {
const result = geo.allData(`199.188.195.120`)
expect(result).toBeDefined()
expect(result).toMatchSnapshot()
})
test(`223.63.194.232`, () => {
const result = geo.allData(`223.63.194.232`)
expect(result).toBeDefined()
expect(result).toMatchSnapshot()
})
})
})