Skip to content
Myr

fd-integer-1.test-d.ts

This file

Path

test-d/stdio/option/fd-integer-1.test-d.ts

42 lines · 1.5 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–33why, one step back
2import {
3 execa,4 execaSync,5 type StdinOption,6 type StdinSyncOption,7 type StdoutStderrOption,8 type StdoutStderrSyncOption,9} from '../../../index.js';1011expectError(await execa('unicorns', {stdin: 1}));12expectError(execaSync('unicorns', {stdin: 1}));13expectError(await execa('unicorns', {stdin: [1]}));14expectError(execaSync('unicorns', {stdin: [1]}));1516await execa('unicorns', {stdout: 1});17execaSync('unicorns', {stdout: 1});18await execa('unicorns', {stdout: [1]});19execaSync('unicorns', {stdout: [1]});2021await execa('unicorns', {stderr: 1});22execaSync('unicorns', {stderr: 1});23await execa('unicorns', {stderr: [1]});24execaSync('unicorns', {stderr: [1]});2526expectError(await execa('unicorns', {stdio: 1}));27expectError(execaSync('unicorns', {stdio: 1}));2829await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 1]});30execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 1]});31await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [1]]});32execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [1]]});33

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

lines 34–37why, one step back
34expectTypeOf<1>().not.toBeAssignableTo<StdinOption>();
35expectTypeOf<1>().not.toBeAssignableTo<StdinSyncOption>();36expectTypeOf<[1]>().not.toBeAssignableTo<StdinOption>();37expectTypeOf<[1]>().not.toBeAssignableTo<StdinSyncOption>();

100% test coverage (#1018)ehmickybefore adoption9f65b86

line 38why, one step back
38

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

lines 39–42why, one step back
39expectTypeOf<1>().toBeAssignableTo<StdoutStderrOption>();
40expectTypeOf<1>().toBeAssignableTo<StdoutStderrSyncOption>();41[1] satisfies StdoutStderrOption;42[1] satisfies StdoutStderrSyncOption;