pipe-inherit.test-d.ts
This file
Path
test-d/stdio/option/pipe-inherit.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, expectError} from 'nz';import { execa, execaSync, type StdinOption, type StdinSyncOption, type StdoutStderrOption, type StdoutStderrSyncOption,} from '../../../index.js';
const pipeInherit = ['pipe', 'inherit'] as const;
await execa('unicorns', {stdin: pipeInherit});execaSync('unicorns', {stdin: pipeInherit});
await execa('unicorns', {stdout: pipeInherit});execaSync('unicorns', {stdout: pipeInherit});
await execa('unicorns', {stderr: pipeInherit});execaSync('unicorns', {stderr: pipeInherit});
expectError(await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', pipeInherit]}));execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', pipeInherit]});
expectTypeOf(pipeInherit).toBeAssignableTo<StdinOption>();expectTypeOf(pipeInherit).toBeAssignableTo<StdinSyncOption>();
expectTypeOf(pipeInherit).toBeAssignableTo<StdoutStderrOption>();expectTypeOf(pipeInherit).toBeAssignableTo<StdoutStderrSyncOption>();