Skip to content
Myr

fd-integer-0.test-d.ts

This file

Path

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

52 lines · 2.0 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';1011await execa('unicorns', {stdin: 0});12execaSync('unicorns', {stdin: 0});13await execa('unicorns', {stdin: [0]});14execaSync('unicorns', {stdin: [0]});1516expectError(await execa('unicorns', {stdout: 0}));17expectError(execaSync('unicorns', {stdout: 0}));18expectError(await execa('unicorns', {stdout: [0]}));19expectError(execaSync('unicorns', {stdout: [0]}));2021expectError(await execa('unicorns', {stderr: 0}));22expectError(execaSync('unicorns', {stderr: 0}));23expectError(await execa('unicorns', {stderr: [0]}));24expectError(execaSync('unicorns', {stderr: [0]}));2526expectError(await execa('unicorns', {stdio: 0}));27expectError(execaSync('unicorns', {stdio: 0}));2829await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 0]});30execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 0]});31await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [0]]});32execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [0]]});33

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

lines 34–37why, one step back
34expectTypeOf<0>().toBeAssignableTo<StdinOption>();
35expectTypeOf<0>().toBeAssignableTo<StdinSyncOption>();36[0] satisfies StdinOption;37[0] satisfies 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<0.5>().not.toBeAssignableTo<StdinOption>();
40expectTypeOf<-1>().not.toBeAssignableTo<StdinSyncOption>();41expectTypeOf(Infinity).not.toBeAssignableTo<StdinOption>();42expectTypeOf(NaN).not.toBeAssignableTo<StdinSyncOption>();

100% test coverage (#1018)ehmickybefore adoption9f65b86

line 43why, one step back
43

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

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

100% test coverage (#1018)ehmickybefore adoption9f65b86

line 48why, one step back
48

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

lines 49–52why, one step back
49expectTypeOf<0.5>().not.toBeAssignableTo<StdoutStderrOption>();
50expectTypeOf<-1>().not.toBeAssignableTo<StdoutStderrSyncOption>();51expectTypeOf(Infinity).not.toBeAssignableTo<StdoutStderrOption>();52expectTypeOf(NaN).not.toBeAssignableTo<StdoutStderrSyncOption>();