Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
juergba committed Jul 25, 2021
1 parent 29ca950 commit 99a609c
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
16 changes: 16 additions & 0 deletions test/integration/options/node-flags.spec.js
Expand Up @@ -17,3 +17,19 @@ describe('node flags', function() {
);
});
});

describe('node flags using "--node-option"', function() {
it('should pass fake option to node and fail with node exception', function(done) {
invokeMocha(
['--node-option', 'fake-flag'],
function(err, res) {
if (err) {
return done(err);
}
expect(res, 'to have failed with output', /bad option: --fake-flag/i);
done();
},
'pipe'
);
});
});
17 changes: 16 additions & 1 deletion test/integration/options/timeout.spec.js
Expand Up @@ -50,7 +50,7 @@ describe('--timeout', function() {
});
});

it('should disable timeout with --inspect', function(done) {
it('should disable timeout with "--inspect"', function(done) {
var fixture = 'options/slow-test';
runMochaJSON(fixture, ['--inspect', '--timeout', '200'], function(
err,
Expand All @@ -64,4 +64,19 @@ describe('--timeout', function() {
done();
});
});

it('should disable timeout with "-n inspect"', function(done) {
var fixture = 'options/slow-test';
runMochaJSON(fixture, ['-n', 'inspect', '--timeout', '200'], function(
err,
res
) {
if (err) {
done(err);
return;
}
expect(res, 'to have passed').and('to have passed test count', 2);
done();
});
});
});

0 comments on commit 99a609c

Please sign in to comment.