early-error-file.js
This file
Path
test/fixtures/early-error-file.js
8 lines · 387 bytes · JavaScript
Last changed by
Fix an uncaught error when a file target cannot be opened and the subprocess fails to spawnSindre Sorhusbefore adoption1cee524
History of this fileTake it
123456789#!/usr/bin/env nodeimport process from 'node:process';import {execa} from '../../index.js';import {earlyErrorOptions} from '../helpers/early-error.js';
// The file cannot be opened, since its directory does not existconst {code} = await execa('empty.js', {...earlyErrorOptions, [process.argv[2]]: {file: '/nonexistent-directory-for-execa/file'}, reject: false});console.log(code);