duplex-object.test-d.ts
This file
Path
test-d/stdio/option/duplex-object.test-d.ts
48 lines · 2.1 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 {Duplex} 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–39why, one step back3import {4 execa,5 execaSync,6 type StdinOption,7 type StdinSyncOption,8 type StdoutStderrOption,9 type StdoutStderrSyncOption,10} from '../../../index.js';1112const duplexObjectProperty = {13 transform: new Duplex(),14 objectMode: true as const,15} as const;1617await execa('unicorns', {stdin: duplexObjectProperty});18expectError(execaSync('unicorns', {stdin: duplexObjectProperty}));19await execa('unicorns', {stdin: [duplexObjectProperty]});20expectError(execaSync('unicorns', {stdin: [duplexObjectProperty]}));2122await execa('unicorns', {stdout: duplexObjectProperty});23expectError(execaSync('unicorns', {stdout: duplexObjectProperty}));24await execa('unicorns', {stdout: [duplexObjectProperty]});25expectError(execaSync('unicorns', {stdout: [duplexObjectProperty]}));2627await execa('unicorns', {stderr: duplexObjectProperty});28expectError(execaSync('unicorns', {stderr: duplexObjectProperty}));29await execa('unicorns', {stderr: [duplexObjectProperty]});30expectError(execaSync('unicorns', {stderr: [duplexObjectProperty]}));3132expectError(await execa('unicorns', {stdio: duplexObjectProperty}));33expectError(execaSync('unicorns', {stdio: duplexObjectProperty}));3435await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', duplexObjectProperty]});36expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', duplexObjectProperty]}));37await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [duplexObjectProperty]]});38expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [duplexObjectProperty]]}));39Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
lines 40–43why, one step back40expectTypeOf(duplexObjectProperty).toBeAssignableTo<StdinOption>();41expectTypeOf(duplexObjectProperty).not.toBeAssignableTo<StdinSyncOption>();42[duplexObjectProperty] satisfies StdinOption;43expectTypeOf([duplexObjectProperty]).not.toBeAssignableTo<StdinSyncOption>();100% test coverage (#1018)ehmickybefore adoption9f65b86
line 44why, one step back44Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
lines 45–48why, one step back45expectTypeOf(duplexObjectProperty).toBeAssignableTo<StdoutStderrOption>();46expectTypeOf(duplexObjectProperty).not.toBeAssignableTo<StdoutStderrSyncOption>();47[duplexObjectProperty] satisfies StdoutStderrOption;48expectTypeOf([duplexObjectProperty]).not.toBeAssignableTo<StdoutStderrSyncOption>();