Skip to content
Myr

web-transform.test-d.ts

This file

Path

test-d/stdio/option/web-transform.test-d.ts

45 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.

Fix type of `TransformStream` (#1044)ehmickybefore adoption11bbd9d

line 1why, one step back
1import {TransformStream} 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–36why, one step back
3import {
4 execa,5 execaSync,6 type StdinOption,7 type StdinSyncOption,8 type StdoutStderrOption,9 type StdoutStderrSyncOption,10} from '../../../index.js';1112const webTransform = {transform: new TransformStream()} as const;1314await execa('unicorns', {stdin: webTransform});15expectError(execaSync('unicorns', {stdin: webTransform}));16await execa('unicorns', {stdin: [webTransform]});17expectError(execaSync('unicorns', {stdin: [webTransform]}));1819await execa('unicorns', {stdout: webTransform});20expectError(execaSync('unicorns', {stdout: webTransform}));21await execa('unicorns', {stdout: [webTransform]});22expectError(execaSync('unicorns', {stdout: [webTransform]}));2324await execa('unicorns', {stderr: webTransform});25expectError(execaSync('unicorns', {stderr: webTransform}));26await execa('unicorns', {stderr: [webTransform]});27expectError(execaSync('unicorns', {stderr: [webTransform]}));2829expectError(await execa('unicorns', {stdio: webTransform}));30expectError(execaSync('unicorns', {stdio: webTransform}));3132await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', webTransform]});33expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', webTransform]}));34await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [webTransform]]});35expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [webTransform]]}));36

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

lines 37–40why, one step back
37expectTypeOf(webTransform).toBeAssignableTo<StdinOption>();
38expectTypeOf(webTransform).not.toBeAssignableTo<StdinSyncOption>();39[webTransform] satisfies StdinOption;40expectTypeOf([webTransform]).not.toBeAssignableTo<StdinSyncOption>();

100% test coverage (#1018)ehmickybefore adoption9f65b86

line 41why, one step back
41

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

lines 42–45why, one step back
42expectTypeOf(webTransform).toBeAssignableTo<StdoutStderrOption>();
43expectTypeOf(webTransform).not.toBeAssignableTo<StdoutStderrSyncOption>();44[webTransform] satisfies StdoutStderrOption;45expectTypeOf([webTransform]).not.toBeAssignableTo<StdoutStderrSyncOption>();