final-object-full.test-d.ts
This file
Path
test-d/stdio/option/final-object-full.test-d.ts
52 lines · 1.8 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–43why, one step back2import {3 execa,4 execaSync,5 type StdinOption,6 type StdinSyncOption,7 type StdoutStderrOption,8 type StdoutStderrSyncOption,9} from '../../../index.js';1011const objectFinalFull = {12 * transform(line: unknown) {13 yield JSON.parse(line as string) as object;14 },15 * final() {16 yield {};17 },18 objectMode: true,19} as const;2021await execa('unicorns', {stdin: objectFinalFull});22execaSync('unicorns', {stdin: objectFinalFull});23await execa('unicorns', {stdin: [objectFinalFull]});24execaSync('unicorns', {stdin: [objectFinalFull]});2526await execa('unicorns', {stdout: objectFinalFull});27execaSync('unicorns', {stdout: objectFinalFull});28await execa('unicorns', {stdout: [objectFinalFull]});29execaSync('unicorns', {stdout: [objectFinalFull]});3031await execa('unicorns', {stderr: objectFinalFull});32execaSync('unicorns', {stderr: objectFinalFull});33await execa('unicorns', {stderr: [objectFinalFull]});34execaSync('unicorns', {stderr: [objectFinalFull]});3536expectError(await execa('unicorns', {stdio: objectFinalFull}));37expectError(execaSync('unicorns', {stdio: objectFinalFull}));3839await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', objectFinalFull]});40execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', objectFinalFull]});41await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [objectFinalFull]]});42execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [objectFinalFull]]});43Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
lines 44–47why, one step back44expectTypeOf(objectFinalFull).toBeAssignableTo<StdinOption>();45expectTypeOf(objectFinalFull).toBeAssignableTo<StdinSyncOption>();46[objectFinalFull] satisfies StdinOption;47[objectFinalFull] satisfies StdinSyncOption;100% test coverage (#1018)ehmickybefore adoption9f65b86
line 48why, one step back48Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
lines 49–52why, one step back49expectTypeOf(objectFinalFull).toBeAssignableTo<StdoutStderrOption>();50expectTypeOf(objectFinalFull).toBeAssignableTo<StdoutStderrSyncOption>();51[objectFinalFull] satisfies StdoutStderrOption;52[objectFinalFull] satisfies StdoutStderrSyncOption;