Skip to content

Commit

Permalink
Coverage for posix exit code with normally failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
73rhodes committed Apr 11, 2024
1 parent 592f071 commit 34f2822
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions test/integration/options/posixExitCodes.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var helpers = require('../helpers');
var runMocha = helpers.runMocha;

describe('--posix-exit-codes', function () {
describe('when enabled with node options', function () {
describe('when enabled, and with node options', function () {
var args = ['--no-warnings', '--posix-exit-codes'];

it('should exit with code 134 on SIGABRT', function (done) {
Expand All @@ -28,9 +28,20 @@ describe('--posix-exit-codes', function () {
done();
});
});

it('should exit with code 0 even if there are test failures', function (done) {
var fixture = 'failing.fixture.js';
runMocha(fixture, args, function postmortem(err, res) {
if (err) {
return done(err);
}
expect(res.code, 'to be', 0);
done();
});
});
});

describe('when not enabled with node options', function () {
describe('when not enabled, and with node options', function () {
it('should exit with code null on SIGABRT', function (done) {
var fixture = 'signals-sigabrt.fixture.js';
var args = ['--no-warnings'];
Expand Down

0 comments on commit 34f2822

Please sign in to comment.