Skip to content
Myr

iterable-binary.test-d.ts

This file

Path

test-d/stdio/option/iterable-binary.test-d.ts

48 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–39why, 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 binaryIterableFunction = function * () {12 yield new Uint8Array(0);13};1415const binaryIterable = binaryIterableFunction();1617await execa('unicorns', {stdin: binaryIterable});18execaSync('unicorns', {stdin: binaryIterable});19await execa('unicorns', {stdin: [binaryIterable]});20execaSync('unicorns', {stdin: [binaryIterable]});2122expectError(await execa('unicorns', {stdout: binaryIterable}));23expectError(execaSync('unicorns', {stdout: binaryIterable}));24expectError(await execa('unicorns', {stdout: [binaryIterable]}));25expectError(execaSync('unicorns', {stdout: [binaryIterable]}));2627expectError(await execa('unicorns', {stderr: binaryIterable}));28expectError(execaSync('unicorns', {stderr: binaryIterable}));29expectError(await execa('unicorns', {stderr: [binaryIterable]}));30expectError(execaSync('unicorns', {stderr: [binaryIterable]}));3132expectError(await execa('unicorns', {stdio: binaryIterable}));33expectError(execaSync('unicorns', {stdio: binaryIterable}));3435await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', binaryIterable]});36expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', binaryIterable]}));37await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [binaryIterable]]});38expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [binaryIterable]]}));39

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

lines 40–43why, one step back
40expectTypeOf(binaryIterable).toBeAssignableTo<StdinOption>();
41expectTypeOf(binaryIterable).toBeAssignableTo<StdinSyncOption>();42[binaryIterable] satisfies StdinOption;43[binaryIterable] satisfies StdinSyncOption;

100% test coverage (#1018)ehmickybefore adoption9f65b86

line 44why, one step back
44

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

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