File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -15,20 +15,20 @@ describe("Net", () => {
15
15
describe ( "#isPortAvailable" , ( ) => {
16
16
context ( "when the port is not allowed to be bound" , ( ) => {
17
17
it ( "should return a rejected promise" , ( ) => {
18
- expect ( isPortAvailable ( specialPort , host ) ) . to . eventually . be . rejected ;
18
+ return expect ( isPortAvailable ( specialPort , host ) ) . to . eventually . be . rejected ;
19
19
} ) ;
20
20
} ) ;
21
21
22
22
context ( "when the port is available" , ( ) => {
23
- it ( "should return a fulfilled promise" , ( ) => {
24
- expect ( isPortAvailable ( port + 1 , host ) ) . to . eventually . be . fulfilled ;
23
+ it ( "should return a fulfilled promise" , ( ) => {
24
+ return expect ( isPortAvailable ( port , host ) ) . to . eventually . be . fulfilled ;
25
25
} ) ;
26
26
} ) ;
27
27
28
28
context ( "when the port is unavailable" , ( ) => {
29
29
it ( "should return a rejected promise" , ( ) => {
30
30
createServer ( port ) . then ( ( _ : { close ( ) : any } ) => {
31
- expect ( isPortAvailable ( port , host ) ) . to . eventually . be . rejected ;
31
+ return expect ( isPortAvailable ( port , host ) ) . to . eventually . be . rejected ;
32
32
} ) ;
33
33
} ) ;
34
34
} ) ;
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ const portCheck = (port: number, host: string): Promise<void> => {
21
21
. listen ( { port, host, exclusive : true } )
22
22
. on ( "error" , ( e : any ) => {
23
23
if ( e . code === "EADDRINUSE" ) {
24
- reject ( new Error ( `Port ${ port } is unavailable` ) )
24
+ reject ( new Error ( `Port ${ port } is unavailable on address ${ host } ` ) )
25
25
} else {
26
26
reject ( e ) ;
27
27
}
You can’t perform that action at this time.
0 commit comments