generator-preserve.test-d.ts
This file
Path
test-d/stdio/option/generator-preserve.test-d.ts
49 lines · 2.2 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–40why, one step back2import {3 execa,4 execaSync,5 type StdinOption,6 type StdinSyncOption,7 type StdoutStderrOption,8 type StdoutStderrSyncOption,9} from '../../../index.js';1011const transformWithPreserveNewlines = {12 * transform(line: unknown) {13 yield line;14 },15 preserveNewlines: true,16} as const;1718await execa('unicorns', {stdin: transformWithPreserveNewlines});19execaSync('unicorns', {stdin: transformWithPreserveNewlines});20await execa('unicorns', {stdin: [transformWithPreserveNewlines]});21execaSync('unicorns', {stdin: [transformWithPreserveNewlines]});2223await execa('unicorns', {stdout: transformWithPreserveNewlines});24execaSync('unicorns', {stdout: transformWithPreserveNewlines});25await execa('unicorns', {stdout: [transformWithPreserveNewlines]});26execaSync('unicorns', {stdout: [transformWithPreserveNewlines]});2728await execa('unicorns', {stderr: transformWithPreserveNewlines});29execaSync('unicorns', {stderr: transformWithPreserveNewlines});30await execa('unicorns', {stderr: [transformWithPreserveNewlines]});31execaSync('unicorns', {stderr: [transformWithPreserveNewlines]});3233expectError(await execa('unicorns', {stdio: transformWithPreserveNewlines}));34expectError(execaSync('unicorns', {stdio: transformWithPreserveNewlines}));3536await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', transformWithPreserveNewlines]});37execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', transformWithPreserveNewlines]});38await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [transformWithPreserveNewlines]]});39execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [transformWithPreserveNewlines]]});40Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
lines 41–44why, one step back41expectTypeOf(transformWithPreserveNewlines).toBeAssignableTo<StdinOption>();42expectTypeOf(transformWithPreserveNewlines).toBeAssignableTo<StdinSyncOption>();43[transformWithPreserveNewlines] satisfies StdinOption;44[transformWithPreserveNewlines] satisfies StdinSyncOption;100% test coverage (#1018)ehmickybefore adoption9f65b86
line 45why, one step back45Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
lines 46–49why, one step back46expectTypeOf(transformWithPreserveNewlines).toBeAssignableTo<StdoutStderrOption>();47expectTypeOf(transformWithPreserveNewlines).toBeAssignableTo<StdoutStderrSyncOption>();48[transformWithPreserveNewlines] satisfies StdoutStderrOption;49[transformWithPreserveNewlines] satisfies StdoutStderrSyncOption;