Skip to content

Commit b9f1229

Browse files
committed
test: fix
1 parent 16e733d commit b9f1229

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

test/server/Server.test.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ const { relative, sep } = require('path');
44
const http = require('http');
55
const webpack = require('webpack');
66
const sockjs = require('sockjs/lib/transport');
7-
const getFreePort = require('../../lib/Server').getFreePort;
87
// TODO(@anshumanv) - Remove this test in next major
98
const findPort = require('../../lib/utils/findPort');
109
const Server = require('../../lib/Server');
1110
const config = require('../fixtures/simple-config/webpack.config');
1211
const port = require('../ports-map').Server;
1312
const isWebpack5 = require('../helpers/isWebpack5');
1413

14+
const getFreePort = Server.getFreePort;
1515
jest.mock('sockjs/lib/transport');
1616

1717
const baseDevConfig = {
@@ -488,9 +488,11 @@ describe('Server', () => {
488488
it("should throws the error when the port isn't found", () => {
489489
expect.assertions(1);
490490

491-
jest.mock('portfinder', () => {return {
492-
getPort: (callback) => callback(new Error('busy')),
493-
}});
491+
jest.mock('portfinder', () => {
492+
return {
493+
getPort: (callback) => callback(new Error('busy')),
494+
};
495+
});
494496

495497
const retryCount = 1;
496498

0 commit comments

Comments
 (0)