process-stdout.test-d.ts
This file
Path
test-d/stdio/option/process-stdout.test-d.ts
43 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.
100% test coverage (#1018)ehmickybefore adoption9f65b86
line 1why, one step back1import * as process from 'node:process';Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
line 2why, one step back2import {expectTypeOf, expectError} from 'nz';100% test coverage (#1018)ehmickybefore adoption9f65b86
lines 3–34why, one step back3import {4 execa,5 execaSync,6 type StdinOption,7 type StdinSyncOption,8 type StdoutStderrOption,9 type StdoutStderrSyncOption,10} from '../../../index.js';1112expectError(await execa('unicorns', {stdin: process.stdout}));13expectError(execaSync('unicorns', {stdin: process.stdout}));14expectError(await execa('unicorns', {stdin: [process.stdout]}));15expectError(execaSync('unicorns', {stdin: [process.stdout]}));1617await execa('unicorns', {stdout: process.stdout});18execaSync('unicorns', {stdout: process.stdout});19await execa('unicorns', {stdout: [process.stdout]});20expectError(execaSync('unicorns', {stdout: [process.stdout]}));2122await execa('unicorns', {stderr: process.stdout});23execaSync('unicorns', {stderr: process.stdout});24await execa('unicorns', {stderr: [process.stdout]});25expectError(execaSync('unicorns', {stderr: [process.stdout]}));2627expectError(await execa('unicorns', {stdio: process.stdout}));28expectError(execaSync('unicorns', {stdio: process.stdout}));2930await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', process.stdout]});31execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', process.stdout]});32await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [process.stdout]]});33expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [process.stdout]]}));34Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
lines 35–38why, one step back35expectTypeOf(process.stdout).not.toBeAssignableTo<StdinOption>();36expectTypeOf(process.stdout).not.toBeAssignableTo<StdinSyncOption>();37expectTypeOf([process.stdout]).not.toBeAssignableTo<StdinOption>();38expectTypeOf([process.stdout]).not.toBeAssignableTo<StdinSyncOption>();100% test coverage (#1018)ehmickybefore adoption9f65b86
line 39why, one step back39Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
lines 40–43why, one step back40expectTypeOf(process.stdout).toBeAssignableTo<StdoutStderrOption>();41expectTypeOf(process.stdout).toBeAssignableTo<StdoutStderrSyncOption>();42[process.stdout] satisfies StdoutStderrOption;43expectTypeOf([process.stdout]).not.toBeAssignableTo<StdoutStderrSyncOption>();