File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -750,7 +750,7 @@ class Server {
750
750
}
751
751
}
752
752
753
- listen ( port , hostname , fn ) {
753
+ listen ( port , hostname = this . options . host , fn ) {
754
754
if (
755
755
typeof this . options . host !== 'undefined' &&
756
756
hostname !== this . options . host
Original file line number Diff line number Diff line change @@ -12,7 +12,6 @@ jest.mock('sockjs/lib/transport');
12
12
13
13
const baseDevConfig = {
14
14
port,
15
- host : 'localhost' ,
16
15
static : false ,
17
16
} ;
18
17
@@ -137,6 +136,10 @@ describe('Server', () => {
137
136
compiler = webpack ( config ) ;
138
137
} ) ;
139
138
139
+ afterEach ( ( done ) => {
140
+ server . close ( done ) ;
141
+ } ) ;
142
+
140
143
it ( 'should listen and not throw error' , ( done ) => {
141
144
const options = {
142
145
host : 'localhost' ,
@@ -148,6 +151,17 @@ describe('Server', () => {
148
151
server . close ( done ) ;
149
152
} ) ;
150
153
154
+ it ( 'should work and listen' , ( done ) => {
155
+ const options = {
156
+ host : 'localhost' ,
157
+ } ;
158
+
159
+ server = new Server ( compiler , options ) ;
160
+
161
+ expect ( ( ) => server . listen ( port ) ) . not . toThrowError ( ) ;
162
+ server . close ( done ) ;
163
+ } ) ;
164
+
151
165
it ( 'should throw an error' , ( done ) => {
152
166
const options = {
153
167
host : '192.160.21.34' ,
You can’t perform that action at this time.
0 commit comments