File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -220,6 +220,42 @@ describe('Server', () => {
220
220
} ) ;
221
221
} ) ;
222
222
223
+ it ( 'should work and using "port" from arguments and "host" from options' , ( done ) => {
224
+ const options = {
225
+ host : '127.0.0.1' ,
226
+ } ;
227
+
228
+ server = new Server ( options , compiler ) ;
229
+
230
+ // eslint-disable-next-line no-undefined
231
+ server . listen ( port , undefined , ( ) => {
232
+ const info = server . server . address ( ) ;
233
+
234
+ expect ( info . address ) . toBe ( '127.0.0.1' ) ;
235
+ expect ( info . port ) . toBe ( port ) ;
236
+
237
+ server . close ( done ) ;
238
+ } ) ;
239
+ } ) ;
240
+
241
+ it ( 'should work and using "port" from options and "port" from arguments' , ( done ) => {
242
+ const options = {
243
+ port,
244
+ } ;
245
+
246
+ server = new Server ( options , compiler ) ;
247
+
248
+ // eslint-disable-next-line no-undefined
249
+ server . listen ( undefined , '127.0.0.1' , ( ) => {
250
+ const info = server . server . address ( ) ;
251
+
252
+ expect ( info . address ) . toBe ( '127.0.0.1' ) ;
253
+ expect ( info . port ) . toBe ( port ) ;
254
+
255
+ server . close ( done ) ;
256
+ } ) ;
257
+ } ) ;
258
+
223
259
it ( 'should log warning when the "port" and "host" options from options different from arguments' , ( done ) => {
224
260
const options = {
225
261
host : '127.0.0.2' ,
You can’t perform that action at this time.
0 commit comments