diff --git a/test/return/early-error.js b/test/return/early-error.js index bdfa8a1ee4..b962288b32 100644 --- a/test/return/early-error.js +++ b/test/return/early-error.js @@ -1,3 +1,4 @@ +import {arch} from 'node:os'; import process from 'node:process'; import test from 'ava'; import {execa, execaSync, $} from '../../index.js'; @@ -14,6 +15,7 @@ import { setFixtureDirectory(); const isWindows = process.platform === 'win32'; +const isX64 = arch() === 'x64'; const ENOENT_REGEXP = isWindows ? /failed with exit code 1/ : /spawn.* ENOENT/; test('execaSync() throws error if ENOENT', t => { @@ -62,16 +64,18 @@ if (!isWindows) { await t.throwsAsync(execa('non-executable.js', {input: 'Hey!'}), {message: /EACCES/}); }); - test('write to fast-exit subprocess', async t => { + if (isX64) { + test('write to fast-exit subprocess', async t => { // Try-catch here is necessary, because this test is not 100% accurate // Sometimes subprocess can manage to accept input before exiting - try { - await execa(`fast-exit-${process.platform}`, [], {input: 'data'}); - t.pass(); - } catch (error) { - t.is(error.code, 'EPIPE'); - } - }); + try { + await execa(`fast-exit-${process.platform}`, [], {input: 'data'}); + t.pass(); + } catch (error) { + t.is(error.code, 'EPIPE'); + } + }); + } } const testEarlyErrorPipe = async (t, getSubprocess) => {