Skip to content
Myr

writable-stream.test-d.ts

This file

Path

test-d/stdio/option/writable-stream.test-d.ts

43 lines · 2.1 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.

Fix typing of web streams (#1043)ehmickybefore adoption6f4941e

line 1why, one step back
1import {WritableStream} from 'node:stream/web';

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 WritableStream()}));13expectError(execaSync('unicorns', {stdin: new WritableStream()}));14expectError(await execa('unicorns', {stdin: [new WritableStream()]}));15expectError(execaSync('unicorns', {stdin: [new WritableStream()]}));1617await execa('unicorns', {stdout: new WritableStream()});18expectError(execaSync('unicorns', {stdout: new WritableStream()}));19await execa('unicorns', {stdout: [new WritableStream()]});20expectError(execaSync('unicorns', {stdout: [new WritableStream()]}));2122await execa('unicorns', {stderr: new WritableStream()});23expectError(execaSync('unicorns', {stderr: new WritableStream()}));24await execa('unicorns', {stderr: [new WritableStream()]});25expectError(execaSync('unicorns', {stderr: [new WritableStream()]}));2627expectError(await execa('unicorns', {stdio: new WritableStream()}));28expectError(execaSync('unicorns', {stdio: new WritableStream()}));2930await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', new WritableStream()]});31expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', new WritableStream()]}));32await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [new WritableStream()]]});33expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [new WritableStream()]]}));34

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

lines 35–38why, one step back
35expectTypeOf(new WritableStream()).not.toBeAssignableTo<StdinOption>();
36expectTypeOf(new WritableStream()).not.toBeAssignableTo<StdinSyncOption>();37expectTypeOf([new WritableStream()]).not.toBeAssignableTo<StdinOption>();38expectTypeOf([new WritableStream()]).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 WritableStream()).toBeAssignableTo<StdoutStderrOption>();
41expectTypeOf(new WritableStream()).not.toBeAssignableTo<StdoutStderrSyncOption>();42[new WritableStream()] satisfies StdoutStderrOption;43expectTypeOf([new WritableStream()]).not.toBeAssignableTo<StdoutStderrSyncOption>();