Skip to content
Myr

generator-unknown.test-d.ts

This file

Path

test-d/stdio/option/generator-unknown.test-d.ts

46 lines · 1.8 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–37why, 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 unknownGenerator = function * (line: unknown) {12 yield line;13};1415await execa('unicorns', {stdin: unknownGenerator});16execaSync('unicorns', {stdin: unknownGenerator});17await execa('unicorns', {stdin: [unknownGenerator]});18execaSync('unicorns', {stdin: [unknownGenerator]});1920await execa('unicorns', {stdout: unknownGenerator});21execaSync('unicorns', {stdout: unknownGenerator});22await execa('unicorns', {stdout: [unknownGenerator]});23execaSync('unicorns', {stdout: [unknownGenerator]});2425await execa('unicorns', {stderr: unknownGenerator});26execaSync('unicorns', {stderr: unknownGenerator});27await execa('unicorns', {stderr: [unknownGenerator]});28execaSync('unicorns', {stderr: [unknownGenerator]});2930expectError(await execa('unicorns', {stdio: unknownGenerator}));31expectError(execaSync('unicorns', {stdio: unknownGenerator}));3233await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', unknownGenerator]});34execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', unknownGenerator]});35await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [unknownGenerator]]});36execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [unknownGenerator]]});37

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

lines 38–41why, one step back
38expectTypeOf(unknownGenerator).toBeAssignableTo<StdinOption>();
39expectTypeOf(unknownGenerator).toBeAssignableTo<StdinSyncOption>();40[unknownGenerator] satisfies StdinOption;41[unknownGenerator] satisfies StdinSyncOption;

100% test coverage (#1018)ehmickybefore adoption9f65b86

line 42why, one step back
42

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

lines 43–46why, one step back
43expectTypeOf(unknownGenerator).toBeAssignableTo<StdoutStderrOption>();
44expectTypeOf(unknownGenerator).toBeAssignableTo<StdoutStderrSyncOption>();45[unknownGenerator] satisfies StdoutStderrOption;46[unknownGenerator] satisfies StdoutStderrSyncOption;