Skip to content

Commit 5e722c5

Browse files
committedMar 1, 2025
fix exit code
1 parent 141c142 commit 5e722c5

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed
 

‎packages/diagnostic/server/bun/socket-handler.js

+3
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,16 @@ export function buildHandler(config, state) {
6363
await config.cleanup();
6464
debug(`Configured cleanup hook completed`);
6565
}
66+
debug(`\n\nExiting with code ${exitCode}`);
6667
// 1. We expect all cleanup to have happened after
6768
// config.cleanup(), so exiting here should be safe.
6869
// 2. We also want to forcibly exit with a success code in this
6970
// case.
7071
// eslint-disable-next-line n/no-process-exit
7172
process.exit(exitCode);
7273
}
74+
} else {
75+
console.log(`Waiting for ${state.expected - state.completed} more browsers to finish`);
7376
}
7477

7578
break;

‎packages/diagnostic/server/reporters/default.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import chalk from 'chalk';
22
import fs from 'fs';
33
import path from 'path';
4+
import { exit } from 'process';
45

56
const SLOW_TEST_COUNT = 50;
67
const DEFAULT_TIMEOUT = 8_000;
@@ -219,9 +220,10 @@ export default class CustomDotReporter {
219220
)} ms\n${HEADER_STR}\n\n`
220221
);
221222

223+
const exitCode = this.globalFailures.length || this.failedTests.length ? 1 : 0;
222224
this.clearState();
223225

224-
return this.globalFailures.length || this.failedTests.length ? 1 : 0;
226+
return exitCode;
225227
}
226228

227229
addLauncher(data) {

0 commit comments

Comments
 (0)
Failed to load comments.