parameters-args.js
This file
Path
test/methods/parameters-args.js
54 lines · 2.6 KiB · JavaScript
Last changed by
Upgrade xo (#980)ehmickybefore adoptionccfa412
History of this fileTake it
Rename files (#977)ehmickybefore adoption4b2e316
line 1why, one step back1import test from 'ava';Upgrade xo (#980)ehmickybefore adoptionccfa412
lines 2–10why, one step back2import {3 execa,4 execaSync,5 execaCommand,6 execaCommandSync,7 execaNode,8 $,9} from '../../index.js';10import {setFixtureDirectory} from '../helpers/fixtures-directory.js';Rename files (#977)ehmickybefore adoption4b2e316
line 11why, one step back11Upgrade xo (#980)ehmickybefore adoptionccfa412
line 12why, one step back12setFixtureDirectory();Rename files (#977)ehmickybefore adoption4b2e316
line 13why, one step back13Upgrade xo (#980)ehmickybefore adoptionccfa412
line 14why, one step back14const testInvalidArguments = async (t, execaMethod) => {Rename files (#977)ehmickybefore adoption4b2e316
lines 15–19why, one step back15 t.throws(() => {16 execaMethod('echo', true);17 }, {message: /Second argument must be either/});18};19Upgrade xo (#980)ehmickybefore adoptionccfa412
lines 20–26why, one step back20test('execa()\'s second argument must be valid', testInvalidArguments, execa);21test('execaSync()\'s second argument must be valid', testInvalidArguments, execaSync);22test('execaCommand()\'s second argument must be valid', testInvalidArguments, execaCommand);23test('execaCommandSync()\'s second argument must be valid', testInvalidArguments, execaCommandSync);24test('execaNode()\'s second argument must be valid', testInvalidArguments, execaNode);25test('$\'s second argument must be valid', testInvalidArguments, $);26test('$.sync\'s second argument must be valid', testInvalidArguments, $.sync);Rename files (#977)ehmickybefore adoption4b2e316
line 27why, one step back27Upgrade xo (#980)ehmickybefore adoptionccfa412
line 28why, one step back28const testInvalidArgumentsItems = async (t, execaMethod) => {Rename files (#977)ehmickybefore adoption4b2e316
lines 29–33why, one step back29 t.throws(() => {30 execaMethod('echo', [{}]);31 }, {message: 'Second argument must be an array of strings: [object Object]'});32};33Upgrade xo (#980)ehmickybefore adoptionccfa412
lines 34–40why, one step back34test('execa()\'s second argument must not be objects', testInvalidArgumentsItems, execa);35test('execaSync()\'s second argument must not be objects', testInvalidArgumentsItems, execaSync);36test('execaCommand()\'s second argument must not be objects', testInvalidArgumentsItems, execaCommand);37test('execaCommandSync()\'s second argument must not be objects', testInvalidArgumentsItems, execaCommandSync);38test('execaNode()\'s second argument must not be objects', testInvalidArgumentsItems, execaNode);39test('$\'s second argument must not be objects', testInvalidArgumentsItems, $);40test('$.sync\'s second argument must not be objects', testInvalidArgumentsItems, $.sync);Rename files (#977)ehmickybefore adoption4b2e316
line 41why, one step back41Upgrade xo (#980)ehmickybefore adoptionccfa412
line 42why, one step back42const testNullByteArgument = async (t, execaMethod) => {Rename files (#977)ehmickybefore adoption4b2e316
lines 43–47why, one step back43 t.throws(() => {44 execaMethod('echo', ['a\0b']);45 }, {message: /null bytes/});46};47Upgrade xo (#980)ehmickybefore adoptionccfa412
lines 48–54why, one step back48test('execa()\'s second argument must not include \\0', testNullByteArgument, execa);49test('execaSync()\'s second argument must not include \\0', testNullByteArgument, execaSync);50test('execaCommand()\'s second argument must not include \\0', testNullByteArgument, execaCommand);51test('execaCommandSync()\'s second argument must not include \\0', testNullByteArgument, execaCommandSync);52test('execaNode()\'s second argument must not include \\0', testNullByteArgument, execaNode);53test('$\'s second argument must not include \\0', testNullByteArgument, $);54test('$.sync\'s second argument must not include \\0', testNullByteArgument, $.sync);