pipe-wide.test-d.ts
This file
Path
test-d/stdio/option/pipe-wide.test-d.ts
46 lines · 1.7 KiB · TypeScript
Last changed by
Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
History of this fileTake it
Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
line 1why, one step back1import {expectTypeOf, expectError} from 'nz';Add more type tests (#1117)ehmickybefore adoption077749d
lines 2–37why, one step back2import {3 execa,4 execaSync,5 type StdinOption,6 type StdinSyncOption,7 type StdoutStderrOption,8 type StdoutStderrSyncOption,9} from '../../../index.js';1011const pipe = 'pipe' as string;12const pipes = ['pipe'] as string[];13const pipesOfPipes = [['pipe']] as string[][];1415expectError(await execa('unicorns', {stdin: pipe}));16expectError(execaSync('unicorns', {stdin: pipe}));17expectError(await execa('unicorns', {stdin: pipes}));18expectError(execaSync('unicorns', {stdin: pipes}));1920expectError(await execa('unicorns', {stdout: pipe}));21expectError(execaSync('unicorns', {stdout: pipe}));22expectError(await execa('unicorns', {stdout: pipes}));23expectError(execaSync('unicorns', {stdout: pipes}));2425expectError(await execa('unicorns', {stderr: pipe}));26expectError(execaSync('unicorns', {stderr: pipe}));27expectError(await execa('unicorns', {stderr: pipes}));28expectError(execaSync('unicorns', {stderr: pipes}));2930expectError(await execa('unicorns', {stdio: pipe}));31expectError(execaSync('unicorns', {stdio: pipe}));3233expectError(await execa('unicorns', {stdio: pipes}));34expectError(execaSync('unicorns', {stdio: pipes}));35expectError(await execa('unicorns', {stdio: pipesOfPipes}));36expectError(execaSync('unicorns', {stdio: pipesOfPipes}));37Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
lines 38–41why, one step back38expectTypeOf(pipe).not.toBeAssignableTo<StdinOption>();39expectTypeOf(pipe).not.toBeAssignableTo<StdinSyncOption>();40expectTypeOf(pipes).not.toBeAssignableTo<StdinOption>();41expectTypeOf(pipes).not.toBeAssignableTo<StdinSyncOption>();Add more type tests (#1117)ehmickybefore adoption077749d
line 42why, one step back42Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
lines 43–46why, one step back43expectTypeOf(pipe).not.toBeAssignableTo<StdoutStderrOption>();44expectTypeOf(pipe).not.toBeAssignableTo<StdoutStderrSyncOption>();45expectTypeOf(pipes).not.toBeAssignableTo<StdoutStderrOption>();46expectTypeOf(pipes).not.toBeAssignableTo<StdoutStderrSyncOption>();