Skip to content
Myr

command.js

This file

Path

test/command.js

40 lines · 1.2 KiB · JavaScript

Last changed by

Split files (#791)ehmickybefore adoption932fb26

History of this file

Take it

The walk stopped after 200 commits: lines older than 2f61456 point at it.

Improve docs for `.command`Sindre Sorhusbefore adoption2f61456

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

Split files (#791)ehmickybefore adoption932fb26

line 2why, one step back
2import {execaCommand, execaCommandSync} from '../index.js';

Re-enable Windows in CI (#500)ehmickybefore adoption071d0a2

line 3why, one step back
3import {setFixtureDir} from './helpers/fixtures-dir.js';

Improve docs for `.command`Sindre Sorhusbefore adoption2f61456

line 4why, one step back
4

Re-enable Windows in CI (#500)ehmickybefore adoption071d0a2

line 5why, one step back
5setFixtureDir();

Improve docs for `.command`Sindre Sorhusbefore adoption2f61456

line 6why, one step back
6

Require Node.js 12.20 and move to ESM (#478)Minh Nguyenbefore adoption7707880

line 7why, one step back
7test('execaCommand()', async t => {

Simplify tests (#552)ehmickybefore adoption5fa61d8

line 8why, one step back
8 const {stdout} = await execaCommand('echo.js foo bar');

Improve docs for `.command`Sindre Sorhusbefore adoption2f61456

lines 9–11why, one step back
9 t.is(stdout, 'foo\nbar');
10});11

Require Node.js 12.20 and move to ESM (#478)Minh Nguyenbefore adoption7707880

line 12why, one step back
12test('execaCommand() ignores consecutive spaces', async t => {

Simplify tests (#552)ehmickybefore adoption5fa61d8

line 13why, one step back
13 const {stdout} = await execaCommand('echo.js foo bar');

Improve docs for `.command`Sindre Sorhusbefore adoption2f61456

lines 14–16why, one step back
14 t.is(stdout, 'foo\nbar');
15});16

Require Node.js 12.20 and move to ESM (#478)Minh Nguyenbefore adoption7707880

lines 17–18why, one step back
17test('execaCommand() allows escaping spaces in commands', async t => {
18 const {stdout} = await execaCommand('command\\ with\\ space.js foo bar');

Improve docs for `.command`Sindre Sorhusbefore adoption2f61456

lines 19–21why, one step back
19 t.is(stdout, 'foo\nbar');
20});21

Require Node.js 12.20 and move to ESM (#478)Minh Nguyenbefore adoption7707880

line 22why, one step back
22test('execaCommand() allows escaping spaces in arguments', async t => {

Simplify tests (#552)ehmickybefore adoption5fa61d8

line 23why, one step back
23 const {stdout} = await execaCommand('echo.js foo\\ bar');

Improve docs for `.command`Sindre Sorhusbefore adoption2f61456

lines 24–26why, one step back
24 t.is(stdout, 'foo bar');
25});26

Require Node.js 12.20 and move to ESM (#478)Minh Nguyenbefore adoption7707880

line 27why, one step back
27test('execaCommand() escapes other whitespaces', async t => {

Simplify tests (#552)ehmickybefore adoption5fa61d8

line 28why, one step back
28 const {stdout} = await execaCommand('echo.js foo\tbar');

Improve docs for `.command`Sindre Sorhusbefore adoption2f61456

lines 29–31why, one step back
29 t.is(stdout, 'foo\tbar');
30});31

Require Node.js 12.20 and move to ESM (#478)Minh Nguyenbefore adoption7707880

line 32why, one step back
32test('execaCommand() trims', async t => {

Simplify tests (#552)ehmickybefore adoption5fa61d8

line 33why, one step back
33 const {stdout} = await execaCommand(' echo.js foo bar ');

Improve docs for `.command`Sindre Sorhusbefore adoption2f61456

lines 34–36why, one step back
34 t.is(stdout, 'foo\nbar');
35});36

Require Node.js 12.20 and move to ESM (#478)Minh Nguyenbefore adoption7707880

line 37why, one step back
37test('execaCommandSync()', t => {

Simplify tests (#552)ehmickybefore adoption5fa61d8

line 38why, one step back
38 const {stdout} = execaCommandSync('echo.js foo bar');

Improve docs for `.command`Sindre Sorhusbefore adoption2f61456

line 39why, one step back
39 t.is(stdout, 'foo\nbar');

Fix default value of `stdin` with `$` (#550)ehmickybefore adoption6fe7e51

line 40why, one step back
40});