Skip to content
Myr

generator-only-final.test-d.ts

This file

Path

test-d/stdio/option/generator-only-final.test-d.ts

48 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–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 finalOnly = {12 * final() {13 yield {} as unknown;14 },15} as const;1617expectError(await execa('unicorns', {stdin: finalOnly}));18expectError(execaSync('unicorns', {stdin: finalOnly}));19expectError(await execa('unicorns', {stdin: [finalOnly]}));20expectError(execaSync('unicorns', {stdin: [finalOnly]}));2122expectError(await execa('unicorns', {stdout: finalOnly}));23expectError(execaSync('unicorns', {stdout: finalOnly}));24expectError(await execa('unicorns', {stdout: [finalOnly]}));25expectError(execaSync('unicorns', {stdout: [finalOnly]}));2627expectError(await execa('unicorns', {stderr: finalOnly}));28expectError(execaSync('unicorns', {stderr: finalOnly}));29expectError(await execa('unicorns', {stderr: [finalOnly]}));30expectError(execaSync('unicorns', {stderr: [finalOnly]}));3132expectError(await execa('unicorns', {stdio: finalOnly}));33expectError(execaSync('unicorns', {stdio: finalOnly}));3435expectError(await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', finalOnly]}));36expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', finalOnly]}));37expectError(await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [finalOnly]]}));38expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [finalOnly]]}));39

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

lines 40–43why, one step back
40expectTypeOf(finalOnly).not.toBeAssignableTo<StdinOption>();
41expectTypeOf(finalOnly).not.toBeAssignableTo<StdinSyncOption>();42expectTypeOf([finalOnly]).not.toBeAssignableTo<StdinOption>();43expectTypeOf([finalOnly]).not.toBeAssignableTo<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(finalOnly).not.toBeAssignableTo<StdoutStderrOption>();
46expectTypeOf(finalOnly).not.toBeAssignableTo<StdoutStderrSyncOption>();47expectTypeOf([finalOnly]).not.toBeAssignableTo<StdoutStderrOption>();48expectTypeOf([finalOnly]).not.toBeAssignableTo<StdoutStderrSyncOption>();