Skip to content

Commit 152ebb5

Browse files
committed
fix: polling tests
1 parent ac61c7c commit 152ebb5

File tree

3 files changed

+133
-169
lines changed

3 files changed

+133
-169
lines changed
Lines changed: 66 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -1,103 +1,85 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

33
exports[`'watchFiles' option should work with options {"poll":200} should pass correct options to chokidar config 1`] = `
4-
Array [
5-
"/Users/anshumanv/Code/GitHub/webpack-dev-server/test/fixtures/contentbase-config/public/assets/example.txt",
6-
Object {
7-
"alwaysStat": true,
8-
"atomic": false,
9-
"followSymlinks": false,
10-
"ignoreInitial": true,
11-
"ignorePermissionErrors": true,
12-
"ignored": undefined,
13-
"interval": 200,
14-
"persistent": true,
15-
"usePolling": true,
16-
},
17-
]
4+
Object {
5+
"alwaysStat": true,
6+
"atomic": false,
7+
"followSymlinks": false,
8+
"ignoreInitial": true,
9+
"ignorePermissionErrors": true,
10+
"ignored": undefined,
11+
"interval": 200,
12+
"persistent": true,
13+
"usePolling": true,
14+
}
1815
`;
1916

2017
exports[`'watchFiles' option should work with options {"poll":true} should pass correct options to chokidar config 1`] = `
21-
Array [
22-
"/Users/anshumanv/Code/GitHub/webpack-dev-server/test/fixtures/contentbase-config/public/assets/example.txt",
23-
Object {
24-
"alwaysStat": true,
25-
"atomic": false,
26-
"followSymlinks": false,
27-
"ignoreInitial": true,
28-
"ignorePermissionErrors": true,
29-
"ignored": undefined,
30-
"interval": undefined,
31-
"persistent": true,
32-
"usePolling": true,
33-
},
34-
]
18+
Object {
19+
"alwaysStat": true,
20+
"atomic": false,
21+
"followSymlinks": false,
22+
"ignoreInitial": true,
23+
"ignorePermissionErrors": true,
24+
"ignored": undefined,
25+
"interval": undefined,
26+
"persistent": true,
27+
"usePolling": true,
28+
}
3529
`;
3630

3731
exports[`'watchFiles' option should work with options {"usePolling":false,"poll":true} should pass correct options to chokidar config 1`] = `
38-
Array [
39-
"/Users/anshumanv/Code/GitHub/webpack-dev-server/test/fixtures/contentbase-config/public/assets/example.txt",
40-
Object {
41-
"alwaysStat": true,
42-
"atomic": false,
43-
"followSymlinks": false,
44-
"ignoreInitial": true,
45-
"ignorePermissionErrors": true,
46-
"ignored": undefined,
47-
"interval": undefined,
48-
"persistent": true,
49-
"usePolling": false,
50-
},
51-
]
32+
Object {
33+
"alwaysStat": true,
34+
"atomic": false,
35+
"followSymlinks": false,
36+
"ignoreInitial": true,
37+
"ignorePermissionErrors": true,
38+
"ignored": undefined,
39+
"interval": undefined,
40+
"persistent": true,
41+
"usePolling": false,
42+
}
5243
`;
5344

5445
exports[`'watchFiles' option should work with options {"usePolling":false} should pass correct options to chokidar config 1`] = `
55-
Array [
56-
"/Users/anshumanv/Code/GitHub/webpack-dev-server/test/fixtures/contentbase-config/public/assets/example.txt",
57-
Object {
58-
"alwaysStat": true,
59-
"atomic": false,
60-
"followSymlinks": false,
61-
"ignoreInitial": true,
62-
"ignorePermissionErrors": true,
63-
"ignored": undefined,
64-
"interval": undefined,
65-
"persistent": true,
66-
"usePolling": false,
67-
},
68-
]
46+
Object {
47+
"alwaysStat": true,
48+
"atomic": false,
49+
"followSymlinks": false,
50+
"ignoreInitial": true,
51+
"ignorePermissionErrors": true,
52+
"ignored": undefined,
53+
"interval": undefined,
54+
"persistent": true,
55+
"usePolling": false,
56+
}
6957
`;
7058

7159
exports[`'watchFiles' option should work with options {"usePolling":true,"interval":200,"poll":400} should pass correct options to chokidar config 1`] = `
72-
Array [
73-
"/Users/anshumanv/Code/GitHub/webpack-dev-server/test/fixtures/contentbase-config/public/assets/example.txt",
74-
Object {
75-
"alwaysStat": true,
76-
"atomic": false,
77-
"followSymlinks": false,
78-
"ignoreInitial": true,
79-
"ignorePermissionErrors": true,
80-
"ignored": undefined,
81-
"interval": 200,
82-
"persistent": true,
83-
"usePolling": true,
84-
},
85-
]
60+
Object {
61+
"alwaysStat": true,
62+
"atomic": false,
63+
"followSymlinks": false,
64+
"ignoreInitial": true,
65+
"ignorePermissionErrors": true,
66+
"ignored": undefined,
67+
"interval": 200,
68+
"persistent": true,
69+
"usePolling": true,
70+
}
8671
`;
8772

8873
exports[`'watchFiles' option should work with options {"usePolling":true} should pass correct options to chokidar config 1`] = `
89-
Array [
90-
"/Users/anshumanv/Code/GitHub/webpack-dev-server/test/fixtures/contentbase-config/public/assets/example.txt",
91-
Object {
92-
"alwaysStat": true,
93-
"atomic": false,
94-
"followSymlinks": false,
95-
"ignoreInitial": true,
96-
"ignorePermissionErrors": true,
97-
"ignored": undefined,
98-
"interval": undefined,
99-
"persistent": true,
100-
"usePolling": true,
101-
},
102-
]
74+
Object {
75+
"alwaysStat": true,
76+
"atomic": false,
77+
"followSymlinks": false,
78+
"ignoreInitial": true,
79+
"ignorePermissionErrors": true,
80+
"ignored": undefined,
81+
"interval": undefined,
82+
"persistent": true,
83+
"usePolling": true,
84+
}
10385
`;
Lines changed: 66 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -1,103 +1,85 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

33
exports[`'watchFiles' option should work with options {"poll":200} should pass correct options to chokidar config 1`] = `
4-
Array [
5-
"/Users/anshumanv/Code/GitHub/webpack-dev-server/test/fixtures/contentbase-config/public/assets/example.txt",
6-
Object {
7-
"alwaysStat": true,
8-
"atomic": false,
9-
"followSymlinks": false,
10-
"ignoreInitial": true,
11-
"ignorePermissionErrors": true,
12-
"ignored": undefined,
13-
"interval": 200,
14-
"persistent": true,
15-
"usePolling": true,
16-
},
17-
]
4+
Object {
5+
"alwaysStat": true,
6+
"atomic": false,
7+
"followSymlinks": false,
8+
"ignoreInitial": true,
9+
"ignorePermissionErrors": true,
10+
"ignored": undefined,
11+
"interval": 200,
12+
"persistent": true,
13+
"usePolling": true,
14+
}
1815
`;
1916

2017
exports[`'watchFiles' option should work with options {"poll":true} should pass correct options to chokidar config 1`] = `
21-
Array [
22-
"/Users/anshumanv/Code/GitHub/webpack-dev-server/test/fixtures/contentbase-config/public/assets/example.txt",
23-
Object {
24-
"alwaysStat": true,
25-
"atomic": false,
26-
"followSymlinks": false,
27-
"ignoreInitial": true,
28-
"ignorePermissionErrors": true,
29-
"ignored": undefined,
30-
"interval": undefined,
31-
"persistent": true,
32-
"usePolling": true,
33-
},
34-
]
18+
Object {
19+
"alwaysStat": true,
20+
"atomic": false,
21+
"followSymlinks": false,
22+
"ignoreInitial": true,
23+
"ignorePermissionErrors": true,
24+
"ignored": undefined,
25+
"interval": undefined,
26+
"persistent": true,
27+
"usePolling": true,
28+
}
3529
`;
3630

3731
exports[`'watchFiles' option should work with options {"usePolling":false,"poll":true} should pass correct options to chokidar config 1`] = `
38-
Array [
39-
"/Users/anshumanv/Code/GitHub/webpack-dev-server/test/fixtures/contentbase-config/public/assets/example.txt",
40-
Object {
41-
"alwaysStat": true,
42-
"atomic": false,
43-
"followSymlinks": false,
44-
"ignoreInitial": true,
45-
"ignorePermissionErrors": true,
46-
"ignored": undefined,
47-
"interval": undefined,
48-
"persistent": true,
49-
"usePolling": false,
50-
},
51-
]
32+
Object {
33+
"alwaysStat": true,
34+
"atomic": false,
35+
"followSymlinks": false,
36+
"ignoreInitial": true,
37+
"ignorePermissionErrors": true,
38+
"ignored": undefined,
39+
"interval": undefined,
40+
"persistent": true,
41+
"usePolling": false,
42+
}
5243
`;
5344

5445
exports[`'watchFiles' option should work with options {"usePolling":false} should pass correct options to chokidar config 1`] = `
55-
Array [
56-
"/Users/anshumanv/Code/GitHub/webpack-dev-server/test/fixtures/contentbase-config/public/assets/example.txt",
57-
Object {
58-
"alwaysStat": true,
59-
"atomic": false,
60-
"followSymlinks": false,
61-
"ignoreInitial": true,
62-
"ignorePermissionErrors": true,
63-
"ignored": undefined,
64-
"interval": undefined,
65-
"persistent": true,
66-
"usePolling": false,
67-
},
68-
]
46+
Object {
47+
"alwaysStat": true,
48+
"atomic": false,
49+
"followSymlinks": false,
50+
"ignoreInitial": true,
51+
"ignorePermissionErrors": true,
52+
"ignored": undefined,
53+
"interval": undefined,
54+
"persistent": true,
55+
"usePolling": false,
56+
}
6957
`;
7058

7159
exports[`'watchFiles' option should work with options {"usePolling":true,"interval":200,"poll":400} should pass correct options to chokidar config 1`] = `
72-
Array [
73-
"/Users/anshumanv/Code/GitHub/webpack-dev-server/test/fixtures/contentbase-config/public/assets/example.txt",
74-
Object {
75-
"alwaysStat": true,
76-
"atomic": false,
77-
"followSymlinks": false,
78-
"ignoreInitial": true,
79-
"ignorePermissionErrors": true,
80-
"ignored": undefined,
81-
"interval": 200,
82-
"persistent": true,
83-
"usePolling": true,
84-
},
85-
]
60+
Object {
61+
"alwaysStat": true,
62+
"atomic": false,
63+
"followSymlinks": false,
64+
"ignoreInitial": true,
65+
"ignorePermissionErrors": true,
66+
"ignored": undefined,
67+
"interval": 200,
68+
"persistent": true,
69+
"usePolling": true,
70+
}
8671
`;
8772

8873
exports[`'watchFiles' option should work with options {"usePolling":true} should pass correct options to chokidar config 1`] = `
89-
Array [
90-
"/Users/anshumanv/Code/GitHub/webpack-dev-server/test/fixtures/contentbase-config/public/assets/example.txt",
91-
Object {
92-
"alwaysStat": true,
93-
"atomic": false,
94-
"followSymlinks": false,
95-
"ignoreInitial": true,
96-
"ignorePermissionErrors": true,
97-
"ignored": undefined,
98-
"interval": undefined,
99-
"persistent": true,
100-
"usePolling": true,
101-
},
102-
]
74+
Object {
75+
"alwaysStat": true,
76+
"atomic": false,
77+
"followSymlinks": false,
78+
"ignoreInitial": true,
79+
"ignorePermissionErrors": true,
80+
"ignored": undefined,
81+
"interval": undefined,
82+
"persistent": true,
83+
"usePolling": true,
84+
}
10385
`;

test/server/watchFiles-option.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ describe("'watchFiles' option", () => {
327327
});
328328

329329
it('should pass correct options to chokidar config', () => {
330-
expect(chokidarMock.mock.calls[0]).toMatchSnapshot();
330+
expect(chokidarMock.mock.calls[0][1]).toMatchSnapshot();
331331
});
332332

333333
it('should reload on file content changed', (done) => {

0 commit comments

Comments
 (0)