Skip to content

Commit 39b83c4

Browse files
authored
test(provide-plugin): use port variable (#2008)
1 parent 4dec6b2 commit 39b83c4

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

test/e2e/ProvidePlugin.test.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@
33
const testServer = require('../helpers/test-server');
44
const config = require('../fixtures/provide-plugin-config/webpack.config');
55
const runBrowser = require('../helpers/run-browser');
6+
const port = require('../ports-map').ProvidePlugin;
67

78
describe('ProvidePlugin', () => {
89
describe('inline', () => {
910
beforeAll((done) => {
1011
const options = {
11-
port: 9000,
12+
port,
1213
host: '0.0.0.0',
1314
inline: true,
1415
watchOptions: {
@@ -33,7 +34,7 @@ describe('ProvidePlugin', () => {
3334
browser.close().then(done);
3435
});
3536
});
36-
page.goto('http://localhost:9000/main');
37+
page.goto(`http://localhost:${port}/main`);
3738
});
3839
});
3940
});
@@ -42,7 +43,7 @@ describe('ProvidePlugin', () => {
4243
describe('not inline', () => {
4344
beforeAll((done) => {
4445
const options = {
45-
port: 9000,
46+
port,
4647
host: '0.0.0.0',
4748
inline: false,
4849
watchOptions: {
@@ -68,7 +69,7 @@ describe('ProvidePlugin', () => {
6869
browser.close().then(done);
6970
});
7071
});
71-
page.goto('http://localhost:9000/main');
72+
page.goto(`http://localhost:${port}/main`);
7273
});
7374
});
7475
});

test/ports-map.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ const portsList = {
3434
'serverMode-option': 1,
3535
'sockPath-option': 1,
3636
'stats-option': 1,
37+
ProvidePlugin: 1,
3738
};
3839

3940
let startPort = 8079;

0 commit comments

Comments
 (0)