Fix CI tests (#1207)
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by ehmicky · committed by GitHub · parent 3e8fa32 · Browse files · 2 files·+5 added−4 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
2 files+5 added−4 removed
- tests:+5 added−4 removed
Provenance
- Commit
5587ae1- Tree
66ef93f- Author
ehmicky <ehmicky@users.noreply.github.com>- Committer
GitHub <noreply@github.com>- Parent
3e8fa32
2 files changed+5 added−4 removed
modified:test/arguments/cwd.js+2 added-1 removed
4 unmodified lines567891011121356 unmodified lines7071727373747576777827 unmodified lines4 unmodified linesimport tempfile from 'tempfile';import test from 'ava';import {execa, execaSync} from '../../index.js';import {FIXTURES_DIRECTORY, setFixtureDirectory} from '../helpers/fixtures-directory.js';import {majorNodeVersion} from '../helpers/node-version.js';
setFixtureDirectory();
const isWindows = process.platform === 'win32';56 unmodified lines test.serial('The "cwd" option default fails if current cwd is missing - sync', testCwdPreSpawn, execaSync);}
const cwdNotExisting = {cwd: 'does_not_exist', expectedCode: 'ENOENT', expectedMessage: 'The "cwd" option is invalid'};const cwdTooLong = {cwd: '.'.repeat(1e5), expectedCode: 'ENAMETOOLONG', expectedMessage: 'The "cwd" option is invalid'};const cwdTooLong = {cwd: '.'.repeat(1e5), expectedCode: isWindows && majorNodeVersion >= 20 ? 'ENOENT' : 'ENAMETOOLONG', expectedMessage: 'The "cwd" option is invalid'};// @todo: use import.meta.dirname after dropping support for Node <20.11.0const cwdNotDirectory = {cwd: fileURLToPath(import.meta.url), expectedCode: isWindows ? 'ENOENT' : 'ENOTDIR', expectedMessage: 'The "cwd" option is not a directory'};
const testCwdPostSpawn = async (t, {cwd, expectedCode, expectedMessage}, execaMethod) => {27 unmodified linesmodified:test/ipc/send.js+3 added-3 removed
96 unmodified lines97 }98 };99 100 const getEpipeError = async () => {101- const subprocess = execa('empty.js', {ipc: true});101+ const subprocess = execa('delay.js', ['0'], {ipc: true});102 // eslint-disable-next-line no-constant-condition103 while (true) {104 // eslint-disable-next-line no-await-in-loop105 await subprocess.sendMessage('.');12 unmodified lines118 119 const {exitCode, isTerminated, message, ipcOutput} = await t.throwsAsync(subprocess);120 t.is(exitCode, 1);121 t.false(isTerminated);122- t.true(message.includes('Error: getOneMessage() cannot be used: the parent process has already exited or disconnected'));122+ t.true(message.includes('Error: getOneMessage()'));123 t.deepEqual(ipcOutput, []);124 });125 126 test('Does not hold message events on I/O errors', async t => {5 unmodified lines132 133 const {exitCode, isTerminated, message, ipcOutput} = await t.throwsAsync(subprocess);134 t.is(exitCode, 1);135 t.false(isTerminated);136- t.true(message.includes('Error: getOneMessage() cannot be used: the parent process has already exited or disconnected'));136+ t.true(message.includes('Error: getOneMessage()'));137 t.deepEqual(ipcOutput, ['.']);138 });139 140 test('exports.sendMessage() handles I/O errors', async t => {6 unmodified lines