Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add option to not fail on failing test suite #4771

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
refactor: shared clampedCode
  • Loading branch information
JoshuaKGoldberg committed Jul 20, 2024
commit 3eb4dac300addce92812f58140f4169904d849ad
11 changes: 5 additions & 6 deletions lib/cli/run-helpers.js
Original file line number Diff line number Diff line change
@@ -21,25 +21,24 @@ const {UnmatchedFile} = require('./collect-files');

/**
* Exits Mocha when tests + code under test has finished execution (default)
* @param {number} code - Exit code; typically # of failures
* @param {number} clampedCode - Exit code; typically # of failures
* @ignore
* @private
*/
const exitMochaLater = code => {
const exitMochaLater = clampedCode => {
process.on('exit', () => {
process.exitCode = Math.min(code, 255);
process.exitCode = clampedCode;
});
};

/**
* Exits Mocha when Mocha itself has finished execution, regardless of
* what the tests or code under test is doing.
* @param {number} code - Exit code; typically # of failures
* @param {number} clampedCode - Exit code; typically # of failures
* @ignore
* @private
*/
const exitMocha = code => {
const clampedCode = Math.min(code, 255);
const exitMocha = clampedCode => {
let draining = 0;

// Eagerly set the process's exit code in case stream.write doesn't
Loading