Skip to content
Myr

array-string.test-d.ts

This file

Path

test-d/stdio/option/array-string.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 file

Take it

The walk stopped after 200 commits: lines older than 9f65b86 point at it.

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

line 1why, one step back
1import {expectTypeOf, expectError} from 'nz';

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 2–26why, one step back
2import {
3 execa,4 execaSync,5 type StdinOption,6 type StdinSyncOption,7 type StdoutStderrOption,8 type StdoutStderrSyncOption,9} from '../../../index.js';1011const stringArray = ['foo', 'bar'] as const;1213await execa('unicorns', {stdin: [stringArray]});14execaSync('unicorns', {stdin: [stringArray]});1516expectError(await execa('unicorns', {stdout: [stringArray]}));17expectError(execaSync('unicorns', {stdout: [stringArray]}));1819expectError(await execa('unicorns', {stderr: [stringArray]}));20expectError(execaSync('unicorns', {stderr: [stringArray]}));2122await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [stringArray]]});23expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [stringArray]]}));24await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [[stringArray]]]});25expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [[stringArray]]]}));26

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

lines 27–28why, one step back
27[stringArray] satisfies StdinOption;
28[stringArray] satisfies StdinSyncOption;

100% test coverage (#1018)ehmickybefore adoption9f65b86

line 29why, one step back
29

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

lines 30–31why, one step back
30expectTypeOf([stringArray]).not.toBeAssignableTo<StdoutStderrOption>();
31expectTypeOf([stringArray]).not.toBeAssignableTo<StdoutStderrSyncOption>();