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 e851c61 point at it.

Change documentation of `.cancel()` to mention that it’s deprecated (#512)Leandro Facchinettibefore adoptione851c61

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';

Change documentation of `.cancel()` to mention that it’s deprecated (#512)Leandro Facchinettibefore adoptione851c61

lines 3–7why, one step back
3import {setFixtureDir} from './helpers/fixtures-dir.js';
45setFixtureDir();67test('execaCommand()', async t => {

Simplify tests (#552)ehmickybefore adoption5fa61d8

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

Change documentation of `.cancel()` to mention that it’s deprecated (#512)Leandro Facchinettibefore adoptione851c61

lines 9–12why, one step back
9 t.is(stdout, 'foo\nbar');
10});1112test('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');

Change documentation of `.cancel()` to mention that it’s deprecated (#512)Leandro Facchinettibefore adoptione851c61

lines 14–22why, one step back
14 t.is(stdout, 'foo\nbar');
15});1617test('execaCommand() allows escaping spaces in commands', async t => {18 const {stdout} = await execaCommand('command\\ with\\ space.js foo bar');19 t.is(stdout, 'foo\nbar');20});2122test('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');

Change documentation of `.cancel()` to mention that it’s deprecated (#512)Leandro Facchinettibefore adoptione851c61

lines 24–27why, one step back
24 t.is(stdout, 'foo bar');
25});2627test('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');

Change documentation of `.cancel()` to mention that it’s deprecated (#512)Leandro Facchinettibefore adoptione851c61

lines 29–32why, one step back
29 t.is(stdout, 'foo\tbar');
30});3132test('execaCommand() trims', async t => {

Simplify tests (#552)ehmickybefore adoption5fa61d8

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

Change documentation of `.cancel()` to mention that it’s deprecated (#512)Leandro Facchinettibefore adoptione851c61

lines 34–37why, one step back
34 t.is(stdout, 'foo\nbar');
35});3637test('execaCommandSync()', t => {

Simplify tests (#552)ehmickybefore adoption5fa61d8

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

Change documentation of `.cancel()` to mention that it’s deprecated (#512)Leandro Facchinettibefore adoptione851c61

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});