file-object-invalid.test-d.ts
This file
Path
test-d/stdio/option/file-object-invalid.test-d.ts
44 lines · 2.1 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 invalidFileObject = {file: new URL('file:///test')} as const;1213expectError(await execa('unicorns', {stdin: invalidFileObject}));14expectError(execaSync('unicorns', {stdin: invalidFileObject}));15expectError(await execa('unicorns', {stdin: [invalidFileObject]}));16expectError(execaSync('unicorns', {stdin: [invalidFileObject]}));1718expectError(await execa('unicorns', {stdout: invalidFileObject}));19expectError(execaSync('unicorns', {stdout: invalidFileObject}));20expectError(await execa('unicorns', {stdout: [invalidFileObject]}));21expectError(execaSync('unicorns', {stdout: [invalidFileObject]}));2223expectError(await execa('unicorns', {stderr: invalidFileObject}));24expectError(execaSync('unicorns', {stderr: invalidFileObject}));25expectError(await execa('unicorns', {stderr: [invalidFileObject]}));26expectError(execaSync('unicorns', {stderr: [invalidFileObject]}));2728expectError(await execa('unicorns', {stdio: invalidFileObject}));29expectError(execaSync('unicorns', {stdio: invalidFileObject}));3031expectError(await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', invalidFileObject]}));32expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', invalidFileObject]}));33expectError(await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [invalidFileObject]]}));34expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [invalidFileObject]]}));35Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
lines 36–39why, one step back36expectTypeOf(invalidFileObject).not.toBeAssignableTo<StdinOption>();37expectTypeOf(invalidFileObject).not.toBeAssignableTo<StdinSyncOption>();38expectTypeOf([invalidFileObject]).not.toBeAssignableTo<StdinOption>();39expectTypeOf([invalidFileObject]).not.toBeAssignableTo<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(invalidFileObject).not.toBeAssignableTo<StdoutStderrOption>();42expectTypeOf(invalidFileObject).not.toBeAssignableTo<StdoutStderrSyncOption>();43expectTypeOf([invalidFileObject]).not.toBeAssignableTo<StdoutStderrOption>();44expectTypeOf([invalidFileObject]).not.toBeAssignableTo<StdoutStderrSyncOption>();