Skip to content

Commit

Permalink
peer review changes; retry tests on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
boneskull committed Feb 6, 2019
1 parent 0f6b91d commit 2abc1a8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 19 deletions.
2 changes: 1 addition & 1 deletion bin/mocha
Expand Up @@ -37,7 +37,7 @@ debug('loaded opts', opts);
const disableTimeouts = value => {
if (impliesNoTimeouts(value)) {
debug(`option "${value}" disabled timeouts`);
mochaArgs.timeout = false;
mochaArgs.timeout = 0;
delete mochaArgs.timeouts;
delete mochaArgs.t;
}
Expand Down
27 changes: 9 additions & 18 deletions test/integration/options/debug.spec.js
Expand Up @@ -3,15 +3,8 @@
var helpers = require('../helpers');
var invokeMocha = helpers.invokeMocha;
var DEFAULT_FIXTURE = helpers.DEFAULT_FIXTURE;
var platform = require('os').platform();

describe('--debug', function() {
before(function() {
if (platform === 'win32') {
this.skip();
}
});

describe('Node.js v8+', function() {
before(function() {
if (process.version.substring(0, 2) === 'v6') {
Expand Down Expand Up @@ -54,8 +47,8 @@ describe('--debug', function() {

// debugger must be manually killed
setTimeout(function() {
proc.kill('SIGINT');
}, 1000);
process.kill(proc.pid, 'SIGINT');
}, 2000);
});

it('should respect custom host/port', function(done) {
Expand Down Expand Up @@ -108,19 +101,16 @@ describe('--debug', function() {
if (err) {
return done(err);
}
expect(res, 'to have passed').and(
'to contain output',
/Debugger listening/i
);
expect(res, 'to contain output', /Debugger listening/i);
done();
},
'pipe'
);

// debugger must be manually killed
setTimeout(function() {
proc.kill('SIGINT');
}, 1000);
process.kill(proc.pid, 'SIGINT');
}, 2000);
});

it('should respect custom host/port', function(done) {
Expand All @@ -130,7 +120,8 @@ describe('--debug', function() {
if (err) {
return done(err);
}
expect(res, 'to have passed').and(
expect(
res,
'to contain output',
/Debugger listening on .*127.0.0.1:9229/i
);
Expand All @@ -140,8 +131,8 @@ describe('--debug', function() {
);

setTimeout(function() {
proc.kill('SIGINT');
}, 1000);
process.kill(proc.pid, 'SIGINT');
}, 2000);
});
});
});

0 comments on commit 2abc1a8

Please sign in to comment.