Skip to content

Commit 300b58f

Browse files
committed
test: util findPort
1 parent d20c85d commit 300b58f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/server/Server.test.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ const webpack = require('webpack');
66
const sockjs = require('sockjs/lib/transport');
77
const portfinder = require('portfinder');
88
const getFreePort = require('../../lib/Server').getFreePort;
9+
// TODO(@anshumanv) - Remove this test in next major
10+
const findPort = require('../../lib/utils/findPort');
911
const Server = require('../../lib/Server');
1012
const config = require('../fixtures/simple-config/webpack.config');
1113
const port = require('../ports-map').Server;
@@ -503,5 +505,13 @@ describe('Server', () => {
503505
spy.mockRestore();
504506
});
505507
});
508+
509+
it('should work with findPort util', () => {
510+
process.env.DEFAULT_PORT_RETRY = 5;
511+
512+
return findPort(8082).then((port) => {
513+
expect(port).toEqual(8082);
514+
});
515+
});
506516
});
507517
});

0 commit comments

Comments
 (0)