@brillout/test-e2e 0.6.22 → 0.6.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { runCommandLongRunning };
|
|
2
2
|
import { spawn } from 'child_process';
|
|
3
3
|
import stripAnsi from 'strip-ansi';
|
|
4
|
-
import { assert, runCommandShortLived, humanizeTime, isWindows, isLinux, isCallable } from '../utils.js';
|
|
4
|
+
import { assert, runCommandShortLived, humanizeTime, isWindows, isLinux, isCallable, isMac } from '../utils.js';
|
|
5
5
|
function runCommandLongRunning({ cmd, cwd, killPort, isReadyLog, isReadyTimeout, onStdout, onStderr, onExit, onTerminationError, terminationTimeout, tolerateExitCode, }) {
|
|
6
6
|
if (killPort)
|
|
7
7
|
killByPort(killPort);
|
|
@@ -220,7 +220,12 @@ async function killByPort(port) {
|
|
|
220
220
|
await runCommandShortLived(`fuser -k ${port}/tcp`, { swallowError: true, timeout: 10 * 1000 });
|
|
221
221
|
}
|
|
222
222
|
function isSuccessCode(code, tolerateExitCode) {
|
|
223
|
-
if (code === 0 ||
|
|
223
|
+
if (code === 0 ||
|
|
224
|
+
code === null ||
|
|
225
|
+
// Exit code can be `1` on Windows on nominal exit — I don't know why
|
|
226
|
+
(code === 1 && isWindows()) ||
|
|
227
|
+
// Exit code can be `143` on MacOS on nominal exit — I don't know why
|
|
228
|
+
(code === 143 && isMac())) {
|
|
224
229
|
return true;
|
|
225
230
|
}
|
|
226
231
|
if (tolerateExitCode?.includes(code)) {
|