parameters-options.js
This file
Path
test/methods/parameters-options.js
75 lines · 4.7 KiB · JavaScript
Last changed by
Upgrade xo (#980)ehmickybefore adoptionccfa412
History of this fileTake it
Rename files (#977)ehmickybefore adoption4b2e316
lines 1–2why, one step back1import {join} from 'node:path';2import test from 'ava';Upgrade xo (#980)ehmickybefore adoptionccfa412
lines 3–11why, one step back3import {4 execa,5 execaSync,6 execaCommand,7 execaCommandSync,8 execaNode,9 $,10} from '../../index.js';11import {setFixtureDirectory, FIXTURES_DIRECTORY} from '../helpers/fixtures-directory.js';Rename files (#977)ehmickybefore adoption4b2e316
line 12why, one step back12Upgrade xo (#980)ehmickybefore adoptionccfa412
line 13why, one step back13setFixtureDirectory();Rename files (#977)ehmickybefore adoption4b2e316
line 14why, one step back14Upgrade xo (#980)ehmickybefore adoptionccfa412
line 15why, one step back15const NOOP_PATH = join(FIXTURES_DIRECTORY, 'noop.js');Rename files (#977)ehmickybefore adoption4b2e316
line 16why, one step back16Upgrade xo (#980)ehmickybefore adoptionccfa412
lines 17–19why, one step back17const testSerializeArgument = async (t, commandArgument, execaMethod) => {18 const {stdout} = await execaMethod(NOOP_PATH, [commandArgument]);19 t.is(stdout, String(commandArgument));Rename files (#977)ehmickybefore adoption4b2e316
lines 20–21why, one step back20};21Upgrade xo (#980)ehmickybefore adoptionccfa412
lines 22–61why, one step back22test('execa()\'s arguments can be numbers', testSerializeArgument, 1, execa);23test('execa()\'s arguments can be booleans', testSerializeArgument, true, execa);24test('execa()\'s arguments can be NaN', testSerializeArgument, Number.NaN, execa);25test('execa()\'s arguments can be Infinity', testSerializeArgument, Number.POSITIVE_INFINITY, execa);26test('execa()\'s arguments can be null', testSerializeArgument, null, execa);27test('execa()\'s arguments can be undefined', testSerializeArgument, undefined, execa);28test('execa()\'s arguments can be bigints', testSerializeArgument, 1n, execa);29test('execa()\'s arguments can be symbols', testSerializeArgument, Symbol('test'), execa);30test('execaSync()\'s arguments can be numbers', testSerializeArgument, 1, execaSync);31test('execaSync()\'s arguments can be booleans', testSerializeArgument, true, execaSync);32test('execaSync()\'s arguments can be NaN', testSerializeArgument, Number.NaN, execaSync);33test('execaSync()\'s arguments can be Infinity', testSerializeArgument, Number.POSITIVE_INFINITY, execaSync);34test('execaSync()\'s arguments can be null', testSerializeArgument, null, execaSync);35test('execaSync()\'s arguments can be undefined', testSerializeArgument, undefined, execaSync);36test('execaSync()\'s arguments can be bigints', testSerializeArgument, 1n, execaSync);37test('execaSync()\'s arguments can be symbols', testSerializeArgument, Symbol('test'), execaSync);38test('execaNode()\'s arguments can be numbers', testSerializeArgument, 1, execaNode);39test('execaNode()\'s arguments can be booleans', testSerializeArgument, true, execaNode);40test('execaNode()\'s arguments can be NaN', testSerializeArgument, Number.NaN, execaNode);41test('execaNode()\'s arguments can be Infinity', testSerializeArgument, Number.POSITIVE_INFINITY, execaNode);42test('execaNode()\'s arguments can be null', testSerializeArgument, null, execaNode);43test('execaNode()\'s arguments can be undefined', testSerializeArgument, undefined, execaNode);44test('execaNode()\'s arguments can be bigints', testSerializeArgument, 1n, execaNode);45test('execaNode()\'s arguments can be symbols', testSerializeArgument, Symbol('test'), execaNode);46test('$\'s arguments can be numbers', testSerializeArgument, 1, $);47test('$\'s arguments can be booleans', testSerializeArgument, true, $);48test('$\'s arguments can be NaN', testSerializeArgument, Number.NaN, $);49test('$\'s arguments can be Infinity', testSerializeArgument, Number.POSITIVE_INFINITY, $);50test('$\'s arguments can be null', testSerializeArgument, null, $);51test('$\'s arguments can be undefined', testSerializeArgument, undefined, $);52test('$\'s arguments can be bigints', testSerializeArgument, 1n, $);53test('$\'s arguments can be symbols', testSerializeArgument, Symbol('test'), $);54test('$.sync\'s arguments can be numbers', testSerializeArgument, 1, $.sync);55test('$.sync\'s arguments can be booleans', testSerializeArgument, true, $.sync);56test('$.sync\'s arguments can be NaN', testSerializeArgument, Number.NaN, $.sync);57test('$.sync\'s arguments can be Infinity', testSerializeArgument, Number.POSITIVE_INFINITY, $.sync);58test('$.sync\'s arguments can be null', testSerializeArgument, null, $.sync);59test('$.sync\'s arguments can be undefined', testSerializeArgument, undefined, $.sync);60test('$.sync\'s arguments can be bigints', testSerializeArgument, 1n, $.sync);61test('$.sync\'s arguments can be symbols', testSerializeArgument, Symbol('test'), $.sync);Rename files (#977)ehmickybefore adoption4b2e316
lines 62–75why, one step back6263const testInvalidOptions = async (t, execaMethod) => {64 t.throws(() => {65 execaMethod('echo', [], new Map());66 }, {message: /Last argument must be an options object/});67};6869test('execa()\'s third argument must be a plain object', testInvalidOptions, execa);70test('execaSync()\'s third argument must be a plain object', testInvalidOptions, execaSync);71test('execaCommand()\'s third argument must be a plain object', testInvalidOptions, execaCommand);72test('execaCommandSync()\'s third argument must be a plain object', testInvalidOptions, execaCommandSync);73test('execaNode()\'s third argument must be a plain object', testInvalidOptions, execaNode);74test('$\'s third argument must be a plain object', testInvalidOptions, $);75test('$.sync\'s third argument must be a plain object', testInvalidOptions, $.sync);