Skip to content
Myr

writable.test-d.ts

This file

Path

test-d/stdio/option/writable.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 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 {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–34why, one step back
3import {
4 execa,5 execaSync,6 type StdinOption,7 type StdinSyncOption,8 type StdoutStderrOption,9 type StdoutStderrSyncOption,10} from '../../../index.js';1112expectError(await execa('unicorns', {stdin: new Writable()}));13expectError(execaSync('unicorns', {stdin: new Writable()}));14expectError(await execa('unicorns', {stdin: [new Writable()]}));15expectError(execaSync('unicorns', {stdin: [new Writable()]}));1617await execa('unicorns', {stdout: new Writable()});18execaSync('unicorns', {stdout: new Writable()});19await execa('unicorns', {stdout: [new Writable()]});20expectError(execaSync('unicorns', {stdout: [new Writable()]}));2122await execa('unicorns', {stderr: new Writable()});23execaSync('unicorns', {stderr: new Writable()});24await execa('unicorns', {stderr: [new Writable()]});25expectError(execaSync('unicorns', {stderr: [new Writable()]}));2627expectError(await execa('unicorns', {stdio: new Writable()}));28expectError(execaSync('unicorns', {stdio: new Writable()}));2930await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', new Writable()]});31execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', new Writable()]});32await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [new Writable()]]});33expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [new Writable()]]}));34

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

lines 35–38why, one step back
35expectTypeOf(new Writable()).not.toBeAssignableTo<StdinOption>();
36expectTypeOf(new Writable()).not.toBeAssignableTo<StdinSyncOption>();37expectTypeOf([new Writable()]).not.toBeAssignableTo<StdinOption>();38expectTypeOf([new Writable()]).not.toBeAssignableTo<StdinSyncOption>();

100% test coverage (#1018)ehmickybefore adoption9f65b86

line 39why, one step back
39

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

lines 40–43why, one step back
40expectTypeOf(new Writable()).toBeAssignableTo<StdoutStderrOption>();
41expectTypeOf(new Writable()).toBeAssignableTo<StdoutStderrSyncOption>();42[new Writable()] satisfies StdoutStderrOption;43expectTypeOf([new Writable()]).not.toBeAssignableTo<StdoutStderrSyncOption>();