Skip to content

Commit 091ed74

Browse files
authored
Fix test on non-x64 machines (#1163)
1 parent a4d13df commit 091ed74

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

test/return/early-error.js

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import {arch} from 'node:os';
12
import process from 'node:process';
23
import test from 'ava';
34
import {execa, execaSync, $} from '../../index.js';
@@ -62,16 +63,18 @@ if (!isWindows) {
6263
await t.throwsAsync(execa('non-executable.js', {input: 'Hey!'}), {message: /EACCES/});
6364
});
6465

65-
test('write to fast-exit subprocess', async t => {
66+
if (arch() === 'x64') {
67+
test('write to fast-exit subprocess', async t => {
6668
// Try-catch here is necessary, because this test is not 100% accurate
6769
// Sometimes subprocess can manage to accept input before exiting
68-
try {
69-
await execa(`fast-exit-${process.platform}`, [], {input: 'data'});
70-
t.pass();
71-
} catch (error) {
72-
t.is(error.code, 'EPIPE');
73-
}
74-
});
70+
try {
71+
await execa(`fast-exit-${process.platform}`, [], {input: 'data'});
72+
t.pass();
73+
} catch (error) {
74+
t.is(error.code, 'EPIPE');
75+
}
76+
});
77+
}
7578
}
7679

7780
const testEarlyErrorPipe = async (t, getSubprocess) => {

0 commit comments

Comments
 (0)