Skip to content
Myr

web-transform-object.test-d.ts

This file

Path

test-d/stdio/option/web-transform-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 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–39why, 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 webTransformObject = {13 transform: new TransformStream(),14 objectMode: true as const,15} as const;1617await execa('unicorns', {stdin: webTransformObject});18expectError(execaSync('unicorns', {stdin: webTransformObject}));19await execa('unicorns', {stdin: [webTransformObject]});20expectError(execaSync('unicorns', {stdin: [webTransformObject]}));2122await execa('unicorns', {stdout: webTransformObject});23expectError(execaSync('unicorns', {stdout: webTransformObject}));24await execa('unicorns', {stdout: [webTransformObject]});25expectError(execaSync('unicorns', {stdout: [webTransformObject]}));2627await execa('unicorns', {stderr: webTransformObject});28expectError(execaSync('unicorns', {stderr: webTransformObject}));29await execa('unicorns', {stderr: [webTransformObject]});30expectError(execaSync('unicorns', {stderr: [webTransformObject]}));3132expectError(await execa('unicorns', {stdio: webTransformObject}));33expectError(execaSync('unicorns', {stdio: webTransformObject}));3435await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', webTransformObject]});36expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', webTransformObject]}));37await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [webTransformObject]]});38expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [webTransformObject]]}));39

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

lines 40–43why, one step back
40expectTypeOf(webTransformObject).toBeAssignableTo<StdinOption>();
41expectTypeOf(webTransformObject).not.toBeAssignableTo<StdinSyncOption>();42[webTransformObject] satisfies StdinOption;43expectTypeOf([webTransformObject]).not.toBeAssignableTo<StdinSyncOption>();

100% test coverage (#1018)ehmickybefore adoption9f65b86

line 44why, one step back
44

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

lines 45–48why, one step back
45expectTypeOf(webTransformObject).toBeAssignableTo<StdoutStderrOption>();
46expectTypeOf(webTransformObject).not.toBeAssignableTo<StdoutStderrSyncOption>();47[webTransformObject] satisfies StdoutStderrOption;48expectTypeOf([webTransformObject]).not.toBeAssignableTo<StdoutStderrSyncOption>();