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
Fix an uncaught error when a file target cannot be opened and the subprocess fails to spawnSindre Sorhusbefore adoption1cee524
lines 1–8why, one step back1#!/usr/bin/env node2import process from 'node:process';3import {execa} from '../../index.js';4import {earlyErrorOptions} from '../helpers/early-error.js';56// The file cannot be opened, since its directory does not exist7const {code} = await execa('empty.js', {...earlyErrorOptions, [process.argv[2]]: {file: '/nonexistent-directory-for-execa/file'}, reject: false});8console.log(code);