Skip to content
Myr

generator-unknown-full.test-d.ts

This file

Path

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

49 lines · 1.9 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–40why, 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 unknownGeneratorFull = {12 * transform(line: unknown) {13 yield line;14 },15 objectMode: true,16} as const;1718await execa('unicorns', {stdin: unknownGeneratorFull});19execaSync('unicorns', {stdin: unknownGeneratorFull});20await execa('unicorns', {stdin: [unknownGeneratorFull]});21execaSync('unicorns', {stdin: [unknownGeneratorFull]});2223await execa('unicorns', {stdout: unknownGeneratorFull});24execaSync('unicorns', {stdout: unknownGeneratorFull});25await execa('unicorns', {stdout: [unknownGeneratorFull]});26execaSync('unicorns', {stdout: [unknownGeneratorFull]});2728await execa('unicorns', {stderr: unknownGeneratorFull});29execaSync('unicorns', {stderr: unknownGeneratorFull});30await execa('unicorns', {stderr: [unknownGeneratorFull]});31execaSync('unicorns', {stderr: [unknownGeneratorFull]});3233expectError(await execa('unicorns', {stdio: unknownGeneratorFull}));34expectError(execaSync('unicorns', {stdio: unknownGeneratorFull}));3536await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', unknownGeneratorFull]});37execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', unknownGeneratorFull]});38await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [unknownGeneratorFull]]});39execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [unknownGeneratorFull]]});40

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

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

100% test coverage (#1018)ehmickybefore adoption9f65b86

line 45why, one step back
45

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

lines 46–49why, one step back
46expectTypeOf(unknownGeneratorFull).toBeAssignableTo<StdoutStderrOption>();
47expectTypeOf(unknownGeneratorFull).toBeAssignableTo<StdoutStderrSyncOption>();48[unknownGeneratorFull] satisfies StdoutStderrOption;49[unknownGeneratorFull] satisfies StdoutStderrSyncOption;