readable.test-d.ts
This file
Path
test-d/stdio/option/readable.test-d.ts
43 lines · 1.9 KiB · TypeScript
Last changed by
Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
History of this fileTake it
The walk stopped after 200 commits: lines older than 9f65b86 point at it.
100% test coverage (#1018)ehmickybefore adoption9f65b86
line 1why, one step back1import {Readable} from 'node:stream';Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
line 2why, one step back2import {expectTypeOf, expectError} from 'nz';100% test coverage (#1018)ehmickybefore adoption9f65b86
lines 3–34why, one step back3import {4 execa,5 execaSync,6 type StdinOption,7 type StdinSyncOption,8 type StdoutStderrOption,9 type StdoutStderrSyncOption,10} from '../../../index.js';1112await execa('unicorns', {stdin: new Readable()});13execaSync('unicorns', {stdin: new Readable()});14await execa('unicorns', {stdin: [new Readable()]});15expectError(execaSync('unicorns', {stdin: [new Readable()]}));1617expectError(await execa('unicorns', {stdout: new Readable()}));18expectError(execaSync('unicorns', {stdout: new Readable()}));19expectError(await execa('unicorns', {stdout: [new Readable()]}));20expectError(execaSync('unicorns', {stdout: [new Readable()]}));2122expectError(await execa('unicorns', {stderr: new Readable()}));23expectError(execaSync('unicorns', {stderr: new Readable()}));24expectError(await execa('unicorns', {stderr: [new Readable()]}));25expectError(execaSync('unicorns', {stderr: [new Readable()]}));2627expectError(await execa('unicorns', {stdio: new Readable()}));28expectError(execaSync('unicorns', {stdio: new Readable()}));2930await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', new Readable()]});31execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', new Readable()]});32await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [new Readable()]]});33expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [new Readable()]]}));34Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
lines 35–38why, one step back35expectTypeOf(new Readable()).toBeAssignableTo<StdinOption>();36expectTypeOf(new Readable()).toBeAssignableTo<StdinSyncOption>();37[new Readable()] satisfies StdinOption;38expectTypeOf([new Readable()]).not.toBeAssignableTo<StdinSyncOption>();100% test coverage (#1018)ehmickybefore adoption9f65b86
line 39why, one step back39Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
lines 40–43why, one step back40expectTypeOf(new Readable()).not.toBeAssignableTo<StdoutStderrOption>();41expectTypeOf(new Readable()).not.toBeAssignableTo<StdoutStderrSyncOption>();42expectTypeOf([new Readable()]).not.toBeAssignableTo<StdoutStderrOption>();43expectTypeOf([new Readable()]).not.toBeAssignableTo<StdoutStderrSyncOption>();