Skip to content
Myr

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 file

Take it

Rename files (#977)ehmickybefore adoption4b2e316

line 1why, one step back
1import test from 'ava';

Upgrade xo (#980)ehmickybefore adoptionccfa412

lines 2–8why, one step back
2import {
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 back
9

Upgrade xo (#980)ehmickybefore adoptionccfa412

line 10why, one step back
10setFixtureDirectory();

Rename files (#977)ehmickybefore adoption4b2e316

line 11why, one step back
11

Upgrade xo (#980)ehmickybefore adoptionccfa412

line 12why, one step back
12const testInvalidArguments = async (t, execaMethod) => {

Rename files (#977)ehmickybefore adoption4b2e316

lines 13–17why, one step back
13 t.throws(() => {
14 execaMethod('echo', true);15 }, {message: /Second argument must be either/});16};17

Upgrade xo (#980)ehmickybefore adoptionccfa412

lines 18–22why, one step back
18test('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 back
23

Upgrade xo (#980)ehmickybefore adoptionccfa412

line 24why, one step back
24const testInvalidArgumentsItems = async (t, execaMethod) => {

Rename files (#977)ehmickybefore adoption4b2e316

lines 25–29why, one step back
25 t.throws(() => {
26 execaMethod('echo', [{}]);27 }, {message: 'Second argument must be an array of strings: [object Object]'});28};29

Upgrade xo (#980)ehmickybefore adoptionccfa412

lines 30–34why, one step back
30test('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 back
35

Upgrade xo (#980)ehmickybefore adoptionccfa412

line 36why, one step back
36const testNullByteArgument = async (t, execaMethod) => {

Rename files (#977)ehmickybefore adoption4b2e316

lines 37–41why, one step back
37 t.throws(() => {
38 execaMethod('echo', ['a\0b']);39 }, {message: /null bytes/});40};41

Upgrade xo (#980)ehmickybefore adoptionccfa412

lines 42–46why, one step back
42test('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);