nested-node.js
This file
Path
test/fixtures/nested-node.js
17 lines · 650 bytes · JavaScript
Last changed by
Upgrade xo (#980)ehmickybefore adoptionccfa412
History of this fileTake it
Improve tests for `execaNode()` (#777)ehmickybefore adoption27bb798
lines 1–2why, one step back1#!/usr/bin/env node2import process from 'node:process';Improve test helpers (#910)ehmickybefore adoptiona29352f
line 3why, one step back3import {getWriteStream} from '../helpers/fs.js';Add `node` option (#804)ehmickybefore adoption663136b
line 4why, one step back4import {execa, execaNode} from '../../index.js';Improve tests for `execaNode()` (#777)ehmickybefore adoption27bb798
line 5why, one step back5Upgrade xo (#980)ehmickybefore adoptionccfa412
line 6why, one step back6const [fakeExecArgv, execaMethod, nodeOptions, file, ...commandArguments] = process.argv.slice(2);Improve tests for `execaNode()` (#777)ehmickybefore adoption27bb798
lines 7–11why, one step back78if (fakeExecArgv !== '') {9 process.execArgv = [fakeExecArgv];10}11Add `node` option (#804)ehmickybefore adoption663136b
lines 12–13why, one step back12const filteredNodeOptions = [nodeOptions].filter(Boolean);13const {stdout, stderr} = await (execaMethod === 'execaNode'Upgrade xo (#980)ehmickybefore adoptionccfa412
lines 14–15why, one step back14 ? execaNode(file, commandArguments, {nodeOptions: filteredNodeOptions})15 : execa(file, commandArguments, {nodeOptions: filteredNodeOptions, node: true}));Improve tests for `execaNode()` (#777)ehmickybefore adoption27bb798
line 16why, one step back16console.log(stdout);Improve test helpers (#910)ehmickybefore adoptiona29352f
line 17why, one step back17getWriteStream(3).write(stderr);