Skip to content
Myr

generator-boolean.test-d.ts

This file

Path

test-d/stdio/option/generator-boolean.test-d.ts

47 lines · 2.3 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–10why, one step back
2import {
3 execa,4 execaSync,5 type StdinOption,6 type StdinSyncOption,7 type StdoutStderrOption,8 type StdoutStderrSyncOption,9} from '../../../index.js';10

Update dev dependencies (#1257)Sindre Sorhusbefore adoption5944b2d

line 11why, one step back
11// eslint-disable-next-line unicorn/consistent-boolean-name -- `line` matches the naming convention used by every other generator test file, mistyped on purpose to test the type error.

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 12–38why, one step back
12const booleanGenerator = function * (line: boolean) {
13 yield line;14};1516expectError(await execa('unicorns', {stdin: booleanGenerator}));17expectError(execaSync('unicorns', {stdin: booleanGenerator}));18expectError(await execa('unicorns', {stdin: [booleanGenerator]}));19expectError(execaSync('unicorns', {stdin: [booleanGenerator]}));2021expectError(await execa('unicorns', {stdout: booleanGenerator}));22expectError(execaSync('unicorns', {stdout: booleanGenerator}));23expectError(await execa('unicorns', {stdout: [booleanGenerator]}));24expectError(execaSync('unicorns', {stdout: [booleanGenerator]}));2526expectError(await execa('unicorns', {stderr: booleanGenerator}));27expectError(execaSync('unicorns', {stderr: booleanGenerator}));28expectError(await execa('unicorns', {stderr: [booleanGenerator]}));29expectError(execaSync('unicorns', {stderr: [booleanGenerator]}));3031expectError(await execa('unicorns', {stdio: booleanGenerator}));32expectError(execaSync('unicorns', {stdio: booleanGenerator}));3334expectError(await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', booleanGenerator]}));35expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', booleanGenerator]}));36expectError(await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [booleanGenerator]]}));37expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [booleanGenerator]]}));38

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

lines 39–42why, one step back
39expectTypeOf(booleanGenerator).not.toBeAssignableTo<StdinOption>();
40expectTypeOf(booleanGenerator).not.toBeAssignableTo<StdinSyncOption>();41expectTypeOf([booleanGenerator]).not.toBeAssignableTo<StdinOption>();42expectTypeOf([booleanGenerator]).not.toBeAssignableTo<StdinSyncOption>();

100% test coverage (#1018)ehmickybefore adoption9f65b86

line 43why, one step back
43

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

lines 44–47why, one step back
44expectTypeOf(booleanGenerator).not.toBeAssignableTo<StdoutStderrOption>();
45expectTypeOf(booleanGenerator).not.toBeAssignableTo<StdoutStderrSyncOption>();46expectTypeOf([booleanGenerator]).not.toBeAssignableTo<StdoutStderrOption>();47expectTypeOf([booleanGenerator]).not.toBeAssignableTo<StdoutStderrSyncOption>();