Skip to content

Commit

Permalink
[test] Mark skipped tests as pending
Browse files Browse the repository at this point in the history
  • Loading branch information
lpinca committed Dec 1, 2017
1 parent 4e7d48a commit 009d05c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
22 changes: 16 additions & 6 deletions test/WebSocket.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,14 @@ describe('WebSocket', function () {
});

ws.on('error', (err) => {
// Skip this test on machines where 127.0.0.2 is disabled.
if (err.code === 'EADDRNOTAVAIL') err = undefined;
wss.close(() => done(err));
wss.close(() => {
//
// Skip this test on machines where 127.0.0.2 is disabled.
//
if (err.code === 'EADDRNOTAVAIL') return this.skip();

done(err);
});
});
});

Expand Down Expand Up @@ -101,9 +106,14 @@ describe('WebSocket', function () {
});

wss.on('error', (err) => {
// Skip this test on machines where IPv6 is not supported.
if (err.code === 'EADDRNOTAVAIL') err = undefined;
wss.close(() => done(err));
wss.close(() => {
//
// Skip this test on machines where IPv6 is not supported.
//
if (err.code === 'EADDRNOTAVAIL') return this.skip();

done(err);
});
});

wss.on('connection', (ws, req) => {
Expand Down
2 changes: 1 addition & 1 deletion test/WebSocketServer.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ describe('WebSocketServer', function () {
//
// Skip this test on Windows as it throws errors for obvious reasons.
//
if (process.platform === 'win32') return done();
if (process.platform === 'win32') return this.skip();

const server = http.createServer();
const sockPath = `/tmp/ws.${crypto.randomBytes(16).toString('hex')}.socket`;
Expand Down

0 comments on commit 009d05c

Please sign in to comment.