Skip to content

Commit

Permalink
fix #342 set child process debug port to available — add integration …
Browse files Browse the repository at this point in the history
…tests
  • Loading branch information
develar committed May 27, 2016
1 parent 5e082a9 commit 8815163
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -1025,5 +1025,20 @@ function generatePassDebugTests(execArgv) {
});
}

function generatePassDebugIntegrationTests(execArgv) {
test('pass ' + execArgv.join(' ') + ' to fork', function (t) {
t.plan(1);

var api = new Api({testOnlyExecArgv: execArgv});
return api.run([path.join(__dirname, 'fixture/debug-arg.js')])
.then(function (result) {
t.is(result.passCount, 1);
});
});
}

generatePassDebugTests(['--debug=0']);
generatePassDebugTests(['--debug']);

generatePassDebugIntegrationTests(['--debug=0']);

5 changes: 5 additions & 0 deletions test/fixture/debug-arg.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import test from '../../';

test(t => {
t.true(process.execArgv[0].indexOf('--debug') === 0);
});

0 comments on commit 8815163

Please sign in to comment.