parameters-args.js
This file
Path
test/methods/parameters-args.js
46 lines · 1.9 KiB · JavaScript
Last changed by
Remove `execaCommand()` and `execaCommandSync()` (#1244)Sindre Sorhusbefore adoption3ced394
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–8why, one step back2import {3 execa,4 execaSync,5 execaNode,6 $,7} from '../../index.js';8import {setFixtureDirectory} from '../helpers/fixtures-directory.js';Rename files (#977)ehmickybefore adoption4b2e316
line 9why, one step back9Upgrade xo (#980)ehmickybefore adoptionccfa412
line 10why, one step back10setFixtureDirectory();Rename files (#977)ehmickybefore adoption4b2e316
line 11why, one step back11Upgrade xo (#980)ehmickybefore adoptionccfa412
line 12why, one step back12const testInvalidArguments = async (t, execaMethod) => {Rename files (#977)ehmickybefore adoption4b2e316
lines 13–17why, one step back13 t.throws(() => {14 execaMethod('echo', true);15 }, {message: /Second argument must be either/});16};17Upgrade xo (#980)ehmickybefore adoptionccfa412
lines 18–22why, one step back18test('execa()\'s second argument must be valid', testInvalidArguments, execa);19test('execaSync()\'s second argument must be valid', testInvalidArguments, execaSync);20test('execaNode()\'s second argument must be valid', testInvalidArguments, execaNode);21test('$\'s second argument must be valid', testInvalidArguments, $);22test('$.sync\'s second argument must be valid', testInvalidArguments, $.sync);Rename files (#977)ehmickybefore adoption4b2e316
line 23why, one step back23Upgrade xo (#980)ehmickybefore adoptionccfa412
line 24why, one step back24const testInvalidArgumentsItems = async (t, execaMethod) => {Rename files (#977)ehmickybefore adoption4b2e316
lines 25–29why, one step back25 t.throws(() => {26 execaMethod('echo', [{}]);27 }, {message: 'Second argument must be an array of strings: [object Object]'});28};29Upgrade xo (#980)ehmickybefore adoptionccfa412
lines 30–34why, one step back30test('execa()\'s second argument must not be objects', testInvalidArgumentsItems, execa);31test('execaSync()\'s second argument must not be objects', testInvalidArgumentsItems, execaSync);32test('execaNode()\'s second argument must not be objects', testInvalidArgumentsItems, execaNode);33test('$\'s second argument must not be objects', testInvalidArgumentsItems, $);34test('$.sync\'s second argument must not be objects', testInvalidArgumentsItems, $.sync);Rename files (#977)ehmickybefore adoption4b2e316
line 35why, one step back35Upgrade xo (#980)ehmickybefore adoptionccfa412
line 36why, one step back36const testNullByteArgument = async (t, execaMethod) => {Rename files (#977)ehmickybefore adoption4b2e316
lines 37–41why, one step back37 t.throws(() => {38 execaMethod('echo', ['a\0b']);39 }, {message: /null bytes/});40};41Upgrade xo (#980)ehmickybefore adoptionccfa412
lines 42–46why, one step back42test('execa()\'s second argument must not include \\0', testNullByteArgument, execa);43test('execaSync()\'s second argument must not include \\0', testNullByteArgument, execaSync);44test('execaNode()\'s second argument must not include \\0', testNullByteArgument, execaNode);45test('$\'s second argument must not include \\0', testNullByteArgument, $);46test('$.sync\'s second argument must not include \\0', testNullByteArgument, $.sync);