Skip to content
Myr

generator-only-binary.test-d.ts

This file

Path

test-d/stdio/option/generator-only-binary.test-d.ts

44 lines · 1.9 KiB · TypeScript

Last changed by

Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147

History of this file

Take 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 back
1import {expectTypeOf, expectError} from 'nz';

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 2–35why, one step back
2import {
3 execa,4 execaSync,5 type StdinOption,6 type StdinSyncOption,7 type StdoutStderrOption,8 type StdoutStderrSyncOption,9} from '../../../index.js';1011const binaryOnly = {binary: true} as const;1213expectError(await execa('unicorns', {stdin: binaryOnly}));14expectError(execaSync('unicorns', {stdin: binaryOnly}));15expectError(await execa('unicorns', {stdin: [binaryOnly]}));16expectError(execaSync('unicorns', {stdin: [binaryOnly]}));1718expectError(await execa('unicorns', {stdout: binaryOnly}));19expectError(execaSync('unicorns', {stdout: binaryOnly}));20expectError(await execa('unicorns', {stdout: [binaryOnly]}));21expectError(execaSync('unicorns', {stdout: [binaryOnly]}));2223expectError(await execa('unicorns', {stderr: binaryOnly}));24expectError(execaSync('unicorns', {stderr: binaryOnly}));25expectError(await execa('unicorns', {stderr: [binaryOnly]}));26expectError(execaSync('unicorns', {stderr: [binaryOnly]}));2728expectError(await execa('unicorns', {stdio: binaryOnly}));29expectError(execaSync('unicorns', {stdio: binaryOnly}));3031expectError(await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', binaryOnly]}));32expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', binaryOnly]}));33expectError(await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [binaryOnly]]}));34expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [binaryOnly]]}));35

Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147

lines 36–39why, one step back
36expectTypeOf(binaryOnly).not.toBeAssignableTo<StdinOption>();
37expectTypeOf(binaryOnly).not.toBeAssignableTo<StdinSyncOption>();38expectTypeOf([binaryOnly]).not.toBeAssignableTo<StdinOption>();39expectTypeOf([binaryOnly]).not.toBeAssignableTo<StdinSyncOption>();

100% test coverage (#1018)ehmickybefore adoption9f65b86

line 40why, one step back
40

Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147

lines 41–44why, one step back
41expectTypeOf(binaryOnly).not.toBeAssignableTo<StdoutStderrOption>();
42expectTypeOf(binaryOnly).not.toBeAssignableTo<StdoutStderrSyncOption>();43expectTypeOf([binaryOnly]).not.toBeAssignableTo<StdoutStderrOption>();44expectTypeOf([binaryOnly]).not.toBeAssignableTo<StdoutStderrSyncOption>();