iterable-object.test-d.ts
This file
Path
test-d/stdio/option/iterable-object.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 fileTake 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 back1import {expectTypeOf, expectError} from 'nz';100% test coverage (#1018)ehmickybefore adoption9f65b86
lines 2–39why, one step back2import {3 execa,4 execaSync,5 type StdinOption,6 type StdinSyncOption,7 type StdoutStderrOption,8 type StdoutStderrSyncOption,9} from '../../../index.js';1011const objectIterableFunction = function * () {12 yield {};13};1415const objectIterable = objectIterableFunction();1617await execa('unicorns', {stdin: objectIterable});18execaSync('unicorns', {stdin: objectIterable});19await execa('unicorns', {stdin: [objectIterable]});20execaSync('unicorns', {stdin: [objectIterable]});2122expectError(await execa('unicorns', {stdout: objectIterable}));23expectError(execaSync('unicorns', {stdout: objectIterable}));24expectError(await execa('unicorns', {stdout: [objectIterable]}));25expectError(execaSync('unicorns', {stdout: [objectIterable]}));2627expectError(await execa('unicorns', {stderr: objectIterable}));28expectError(execaSync('unicorns', {stderr: objectIterable}));29expectError(await execa('unicorns', {stderr: [objectIterable]}));30expectError(execaSync('unicorns', {stderr: [objectIterable]}));3132expectError(await execa('unicorns', {stdio: objectIterable}));33expectError(execaSync('unicorns', {stdio: objectIterable}));3435await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', objectIterable]});36expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', objectIterable]}));37await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [objectIterable]]});38expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [objectIterable]]}));39Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
lines 40–43why, one step back40expectTypeOf(objectIterable).toBeAssignableTo<StdinOption>();41expectTypeOf(objectIterable).toBeAssignableTo<StdinSyncOption>();42[objectIterable] satisfies StdinOption;43[objectIterable] satisfies StdinSyncOption;100% test coverage (#1018)ehmickybefore adoption9f65b86
line 44why, one step back44Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
lines 45–48why, one step back45expectTypeOf(objectIterable).not.toBeAssignableTo<StdoutStderrOption>();46expectTypeOf(objectIterable).not.toBeAssignableTo<StdoutStderrSyncOption>();47expectTypeOf([objectIterable]).not.toBeAssignableTo<StdoutStderrOption>();48expectTypeOf([objectIterable]).not.toBeAssignableTo<StdoutStderrSyncOption>();