pipe-undefined.test-d.ts
This file
Path
test-d/stdio/option/pipe-undefined.test-d.ts
29 lines · 953 bytes · TypeScript
Last changed by
Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
History of this fileTake it
123456789101112131415161718192021222324252627282930import {expectTypeOf} from 'nz';import { execa, execaSync, type StdinOption, type StdinSyncOption, type StdoutStderrOption, type StdoutStderrSyncOption,} from '../../../index.js';
const pipeUndefined = ['pipe', undefined] as const;
await execa('unicorns', {stdin: pipeUndefined});execaSync('unicorns', {stdin: pipeUndefined});
await execa('unicorns', {stdout: pipeUndefined});execaSync('unicorns', {stdout: pipeUndefined});
await execa('unicorns', {stderr: pipeUndefined});execaSync('unicorns', {stderr: pipeUndefined});
await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', pipeUndefined]});execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', pipeUndefined]});
expectTypeOf(pipeUndefined).toBeAssignableTo<StdinOption>();expectTypeOf(pipeUndefined).toBeAssignableTo<StdinSyncOption>();
expectTypeOf(pipeUndefined).toBeAssignableTo<StdoutStderrOption>();expectTypeOf(pipeUndefined).toBeAssignableTo<StdoutStderrSyncOption>();