Skip to content
Myr

command.test-d.ts

This file

Path

test-d/methods/command.test-d.ts

27 lines · 1.1 KiB · TypeScript

Last changed by

Fix `execaNode()` and the `node` option missing IPC in their typesSindre Sorhusbefore adoption2633abb

History of this file

Take it

The walk stopped after 200 commits: lines older than 9f65b86 point at it.

Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147

line 1why, one step back
1import {expectTypeOf, expectError} from 'nz';

100% test coverage (#1018)ehmickybefore adoption9f65b86

line 2why, one step back
2import {

Add `parseCommandString()` (#1054)ehmickybefore adoptionb9474c3

lines 3–7why, one step back
3 execa,
4 execaSync,5 $,6 execaNode,7 parseCommandString,

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 8–11why, one step back
8 type Result,
9 type SyncResult,10} from '../../index.js';11

Add `parseCommandString()` (#1054)ehmickybefore adoptionb9474c3

lines 12–15why, one step back
12expectError(parseCommandString());
13expectError(parseCommandString(true));14expectError(parseCommandString(['unicorns', 'arg']));15

Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147

lines 16–17why, one step back
16expectTypeOf(parseCommandString('')).toBe<string[]>();
17expectTypeOf(parseCommandString('unicorns foo bar')).toBe<string[]>();

Add `parseCommandString()` (#1054)ehmickybefore adoptionb9474c3

line 18why, one step back
18

Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147

lines 19–22why, one step back
19expectTypeOf(await execa`${parseCommandString('unicorns foo bar')}`).toBe<Result<{}>>();
20expectTypeOf(execaSync`${parseCommandString('unicorns foo bar')}`).toBe<SyncResult<{}>>();21expectTypeOf(await $`${parseCommandString('unicorns foo bar')}`).toBe<Result<{}>>();22expectTypeOf($.sync`${parseCommandString('unicorns foo bar')}`).toBe<SyncResult<{}>>();

Fix `execaNode()` and the `node` option missing IPC in their typesSindre Sorhusbefore adoption2633abb

line 23why, one step back
23expectTypeOf(await execaNode`${parseCommandString('foo bar')}`).toBe<Result<{readonly node: true}>>();

Add `parseCommandString()` (#1054)ehmickybefore adoptionb9474c3

line 24why, one step back
24

Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147

lines 25–27why, one step back
25expectTypeOf(await execa`unicorns ${parseCommandString('foo bar')}`).toBe<Result<{}>>();
26expectTypeOf(await execa('unicorns', parseCommandString('foo bar'))).toBe<Result<{}>>();27expectTypeOf(await execa('unicorns', ['foo', ...parseCommandString('bar')])).toBe<Result<{}>>();