file-object.test-d.ts
This file
Path
test-d/stdio/option/file-object.test-d.ts
44 lines · 1.6 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–35why, one step back2import {3 execa,4 execaSync,5 type StdinOption,6 type StdinSyncOption,7 type StdoutStderrOption,8 type StdoutStderrSyncOption,9} from '../../../index.js';1011const fileObject = {file: './test'} as const;1213await execa('unicorns', {stdin: fileObject});14execaSync('unicorns', {stdin: fileObject});15await execa('unicorns', {stdin: [fileObject]});16execaSync('unicorns', {stdin: [fileObject]});1718await execa('unicorns', {stdout: fileObject});19execaSync('unicorns', {stdout: fileObject});20await execa('unicorns', {stdout: [fileObject]});21execaSync('unicorns', {stdout: [fileObject]});2223await execa('unicorns', {stderr: fileObject});24execaSync('unicorns', {stderr: fileObject});25await execa('unicorns', {stderr: [fileObject]});26execaSync('unicorns', {stderr: [fileObject]});2728expectError(await execa('unicorns', {stdio: fileObject}));29expectError(execaSync('unicorns', {stdio: fileObject}));3031await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', fileObject]});32execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', fileObject]});33await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [fileObject]]});34execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [fileObject]]});35Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
lines 36–39why, one step back36expectTypeOf(fileObject).toBeAssignableTo<StdinOption>();37expectTypeOf(fileObject).toBeAssignableTo<StdinSyncOption>();38[fileObject] satisfies StdinOption;39[fileObject] satisfies StdinSyncOption;100% test coverage (#1018)ehmickybefore adoption9f65b86
line 40why, one step back40Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
lines 41–44why, one step back41expectTypeOf(fileObject).toBeAssignableTo<StdoutStderrOption>();42expectTypeOf(fileObject).toBeAssignableTo<StdoutStderrSyncOption>();43[fileObject] satisfies StdoutStderrOption;44[fileObject] satisfies StdoutStderrSyncOption;