Skip to content

Commit e7f951d

Browse files
Merge pull request #21357 from timvandermeij/fix-browser-test-exit-code
Fix missing non-zero exit code for failure cases in `test.mjs`
2 parents 80c8e62 + 8d5fe52 commit e7f951d

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

test/test.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1148,6 +1148,7 @@ async function startBrowsers({ baseUrl, initializeSession, numSessions = 1 }) {
11481148
})
11491149
.catch(function (ex) {
11501150
console.log(`Error while starting ${browserName}: ${ex.message}`);
1151+
session.numErrors = 1;
11511152
closeSession(sessionName);
11521153
});
11531154
}
@@ -1395,6 +1396,7 @@ async function main() {
13951396
// because the teardown logic of the tests did not get a chance to run.
13961397
console.error(e);
13971398
await Promise.all(sessions.map(session => closeSession(session.name)));
1399+
process.exit(1);
13981400
}
13991401
}
14001402

0 commit comments

Comments
 (0)