Skip to content

Commit 4269aa3

Browse files
committed
test: update
1 parent 1fdc6b7 commit 4269aa3

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

test/server/Server.test.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,32 @@ describe('Server', () => {
128128
});
129129
});
130130

131+
describe('listen', () => {
132+
let compiler;
133+
let server;
134+
135+
beforeAll(() => {
136+
compiler = webpack(config);
137+
});
138+
139+
afterEach((done) => {
140+
server.close(() => {
141+
done();
142+
});
143+
});
144+
145+
it('should listen and not throw error', () => {
146+
const options = {
147+
port,
148+
host: 'localhost',
149+
};
150+
151+
server = new Server(compiler, options);
152+
153+
expect(() => server.listen(port, 'localhost')).not.toThrowError();
154+
});
155+
});
156+
131157
describe('checkHost', () => {
132158
let compiler;
133159
let server;

0 commit comments

Comments
 (0)