Skip to content

Commit

Permalink
fix avajs#342 set child process debug port to available — add integra…
Browse files Browse the repository at this point in the history
…tion tests
  • Loading branch information
develar committed Jun 18, 2016
1 parent 5e60a13 commit 1cf393b
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 @@ -1037,5 +1037,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 1cf393b

Please sign in to comment.