web-transform-invalid.test-d.ts
This file
Path
test-d/stdio/option/web-transform-invalid.test-d.ts
48 lines · 2.6 KiB · TypeScript
Last changed by
Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
History of this fileTake it
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849import {TransformStream} from 'node:stream/web';import {expectTypeOf, expectError} from 'nz';import { execa, execaSync, type StdinOption, type StdinSyncOption, type StdoutStderrOption, type StdoutStderrSyncOption,} from '../../../index.js';
const webTransformWithInvalidObjectMode = { transform: new TransformStream(), objectMode: 'true',} as const;
expectError(await execa('unicorns', {stdin: webTransformWithInvalidObjectMode}));expectError(execaSync('unicorns', {stdin: webTransformWithInvalidObjectMode}));expectError(await execa('unicorns', {stdin: [webTransformWithInvalidObjectMode]}));expectError(execaSync('unicorns', {stdin: [webTransformWithInvalidObjectMode]}));
expectError(await execa('unicorns', {stdout: webTransformWithInvalidObjectMode}));expectError(execaSync('unicorns', {stdout: webTransformWithInvalidObjectMode}));expectError(await execa('unicorns', {stdout: [webTransformWithInvalidObjectMode]}));expectError(execaSync('unicorns', {stdout: [webTransformWithInvalidObjectMode]}));
expectError(await execa('unicorns', {stderr: webTransformWithInvalidObjectMode}));expectError(execaSync('unicorns', {stderr: webTransformWithInvalidObjectMode}));expectError(await execa('unicorns', {stderr: [webTransformWithInvalidObjectMode]}));expectError(execaSync('unicorns', {stderr: [webTransformWithInvalidObjectMode]}));
expectError(await execa('unicorns', {stdio: webTransformWithInvalidObjectMode}));expectError(execaSync('unicorns', {stdio: webTransformWithInvalidObjectMode}));
expectError(await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', webTransformWithInvalidObjectMode]}));expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', webTransformWithInvalidObjectMode]}));expectError(await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [webTransformWithInvalidObjectMode]]}));expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [webTransformWithInvalidObjectMode]]}));
expectTypeOf(webTransformWithInvalidObjectMode).not.toBeAssignableTo<StdinOption>();expectTypeOf(webTransformWithInvalidObjectMode).not.toBeAssignableTo<StdinSyncOption>();expectTypeOf([webTransformWithInvalidObjectMode]).not.toBeAssignableTo<StdinOption>();expectTypeOf([webTransformWithInvalidObjectMode]).not.toBeAssignableTo<StdinSyncOption>();
expectTypeOf(webTransformWithInvalidObjectMode).not.toBeAssignableTo<StdoutStderrOption>();expectTypeOf(webTransformWithInvalidObjectMode).not.toBeAssignableTo<StdoutStderrSyncOption>();expectTypeOf([webTransformWithInvalidObjectMode]).not.toBeAssignableTo<StdoutStderrOption>();expectTypeOf([webTransformWithInvalidObjectMode]).not.toBeAssignableTo<StdoutStderrSyncOption>();