-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathjest.setup.js
More file actions
56 lines (54 loc) · 1.66 KB
/
jest.setup.js
File metadata and controls
56 lines (54 loc) · 1.66 KB
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
const fakeServer = require("test-fake-server");
const path = require("path");
module.exports = async function globalSetup() {
const model = {
port: 9090,
api: [
{
method: "GET",
path: "/8.8.8.8/json",
response: path.resolve(__dirname, "./fixtures/8.8.8.8.json")
},
{
method: "GET",
path: "/198.51.100.1/json",
response: path.resolve(
__dirname,
"./fixtures/198.51.100.1.json"
)
},
{
method: "GET",
path: "/AS7922/json",
response: path.resolve(__dirname, "./fixtures/AS7922.json")
},
{
method: "POST",
path: "/batch",
response: path.resolve(__dirname, "./fixtures/batch.json")
},
{
method: "POST",
path: "/tools/map",
response: path.resolve(__dirname, "./fixtures/tools/map.json")
},
{
method: "GET",
path: "/resproxy/175.107.211.204",
response: path.resolve(
__dirname,
"./fixtures/resproxy/175.107.211.204.json"
)
},
{
method: "GET",
path: "/resproxy/8.8.8.8",
response: path.resolve(
__dirname,
"./fixtures/resproxy/8.8.8.8.json"
)
}
]
};
globalThis.server = await fakeServer(model);
};