array-object.test-d.ts
This file
Path
test-d/stdio/option/array-object.test-d.ts
31 lines · 1.1 KiB · TypeScript
Last changed by
Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
History of this fileTake it
1234567891011121314151617181920212223242526272829303132import {expectTypeOf, expectError} from 'nz';import { execa, execaSync, type StdinOption, type StdinSyncOption, type StdoutStderrOption, type StdoutStderrSyncOption,} from '../../../index.js';
const objectArray = [{}, {}] as const;
await execa('unicorns', {stdin: [objectArray]});execaSync('unicorns', {stdin: [objectArray]});
expectError(await execa('unicorns', {stdout: [objectArray]}));expectError(execaSync('unicorns', {stdout: [objectArray]}));
expectError(await execa('unicorns', {stderr: [objectArray]}));expectError(execaSync('unicorns', {stderr: [objectArray]}));
await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [objectArray]]});expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [objectArray]]}));await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [[objectArray]]]});expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [[objectArray]]]}));
[objectArray] satisfies StdinOption;[objectArray] satisfies StdinSyncOption;
expectTypeOf([objectArray]).not.toBeAssignableTo<StdoutStderrOption>();expectTypeOf([objectArray]).not.toBeAssignableTo<StdoutStderrSyncOption>();