final-async-full.test-d.ts
This file
Path
test-d/stdio/option/final-async-full.test-d.ts
51 lines · 1.9 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–42why, one step back2import {3 execa,4 execaSync,5 type StdinOption,6 type StdinSyncOption,7 type StdoutStderrOption,8 type StdoutStderrSyncOption,9} from '../../../index.js';1011const asyncFinalFull = {12 async * transform(line: unknown) {13 yield '';14 },15 async * final() {16 yield '';17 },18} as const;1920await execa('unicorns', {stdin: asyncFinalFull});21expectError(execaSync('unicorns', {stdin: asyncFinalFull}));22await execa('unicorns', {stdin: [asyncFinalFull]});23expectError(execaSync('unicorns', {stdin: [asyncFinalFull]}));2425await execa('unicorns', {stdout: asyncFinalFull});26expectError(execaSync('unicorns', {stdout: asyncFinalFull}));27await execa('unicorns', {stdout: [asyncFinalFull]});28expectError(execaSync('unicorns', {stdout: [asyncFinalFull]}));2930await execa('unicorns', {stderr: asyncFinalFull});31expectError(execaSync('unicorns', {stderr: asyncFinalFull}));32await execa('unicorns', {stderr: [asyncFinalFull]});33expectError(execaSync('unicorns', {stderr: [asyncFinalFull]}));3435expectError(await execa('unicorns', {stdio: asyncFinalFull}));36expectError(execaSync('unicorns', {stdio: asyncFinalFull}));3738await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', asyncFinalFull]});39expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', asyncFinalFull]}));40await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [asyncFinalFull]]});41expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [asyncFinalFull]]}));42Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
lines 43–46why, one step back43expectTypeOf(asyncFinalFull).toBeAssignableTo<StdinOption>();44expectTypeOf(asyncFinalFull).not.toBeAssignableTo<StdinSyncOption>();45[asyncFinalFull] satisfies StdinOption;46expectTypeOf([asyncFinalFull]).not.toBeAssignableTo<StdinSyncOption>();100% test coverage (#1018)ehmickybefore adoption9f65b86
line 47why, one step back47Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
lines 48–51why, one step back48expectTypeOf(asyncFinalFull).toBeAssignableTo<StdoutStderrOption>();49expectTypeOf(asyncFinalFull).not.toBeAssignableTo<StdoutStderrSyncOption>();50[asyncFinalFull] satisfies StdoutStderrOption;51expectTypeOf([asyncFinalFull]).not.toBeAssignableTo<StdoutStderrSyncOption>();