Skip to content
Myr

direction.test-d.ts

This file

Path

test-d/stdio/direction.test-d.ts

41 lines · 2.5 KiB · TypeScript

Last changed by

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

History of this file

Take it

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

100% test coverage (#1018)ehmickybefore adoption9f65b86

line 1why, one step back
1import {Readable, Writable} from 'node:stream';

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

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

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 3–37why, one step back
3import {
4 execa,5 execaSync,6 type StdinOption,7 type StdinSyncOption,8 type StdoutStderrOption,9 type StdoutStderrSyncOption,10} from '../../index.js';1112await execa('unicorns', {stdio: [new Readable(), 'pipe', 'pipe']});13execaSync('unicorns', {stdio: [new Readable(), 'pipe', 'pipe']});14await execa('unicorns', {stdio: [[new Readable()], ['pipe'], ['pipe']]});15expectError(execaSync('unicorns', {stdio: [[new Readable()], ['pipe'], ['pipe']]}));16await execa('unicorns', {stdio: ['pipe', new Writable(), 'pipe']});17execaSync('unicorns', {stdio: ['pipe', new Writable(), 'pipe']});18await execa('unicorns', {stdio: [['pipe'], [new Writable()], ['pipe']]});19expectError(execaSync('unicorns', {stdio: [['pipe'], [new Writable()], ['pipe']]}));20await execa('unicorns', {stdio: ['pipe', 'pipe', new Writable()]});21execaSync('unicorns', {stdio: ['pipe', 'pipe', new Writable()]});22await execa('unicorns', {stdio: [['pipe'], ['pipe'], [new Writable()]]});23expectError(execaSync('unicorns', {stdio: [['pipe'], ['pipe'], [new Writable()]]}));2425expectError(await execa('unicorns', {stdio: [new Writable(), 'pipe', 'pipe']}));26expectError(execaSync('unicorns', {stdio: [new Writable(), 'pipe', 'pipe']}));27expectError(await execa('unicorns', {stdio: [[new Writable()], ['pipe'], ['pipe']]}));28expectError(execaSync('unicorns', {stdio: [[new Writable()], ['pipe'], ['pipe']]}));29expectError(await execa('unicorns', {stdio: ['pipe', new Readable(), 'pipe']}));30expectError(execaSync('unicorns', {stdio: ['pipe', new Readable(), 'pipe']}));31expectError(await execa('unicorns', {stdio: [['pipe'], [new Readable()], ['pipe']]}));32expectError(execaSync('unicorns', {stdio: [['pipe'], [new Readable()], ['pipe']]}));33expectError(await execa('unicorns', {stdio: ['pipe', 'pipe', new Readable()]}));34expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', new Readable()]}));35expectError(await execa('unicorns', {stdio: [['pipe'], ['pipe'], [new Readable()]]}));36expectError(execaSync('unicorns', {stdio: [['pipe'], ['pipe'], [new Readable()]]}));37

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

lines 38–41why, one step back
38[new Uint8Array(), new Uint8Array()] satisfies StdinOption | StdoutStderrOption;
39[new Uint8Array(), new Uint8Array()] satisfies StdinSyncOption | StdoutStderrSyncOption;40expectTypeOf([new Writable(), new Uint8Array()]).not.toBeAssignableTo<StdinOption | StdoutStderrOption>();41expectTypeOf([new Writable(), new Uint8Array()]).not.toBeAssignableTo<StdinSyncOption | StdoutStderrSyncOption>();