generator-boolean-full.test-d.ts
This file
Path
test-d/stdio/option/generator-boolean-full.test-d.ts
49 lines · 2.4 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–11why, one step back2import {3 execa,4 execaSync,5 type StdinOption,6 type StdinSyncOption,7 type StdoutStderrOption,8 type StdoutStderrSyncOption,9} from '../../../index.js';1011const booleanGeneratorFull = {Update dev dependencies (#1257)Sindre Sorhusbefore adoption5944b2d
line 12why, one step back12 // 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 13–40why, one step back13 * transform(line: boolean) {14 yield line;15 },16} as const;1718expectError(await execa('unicorns', {stdin: booleanGeneratorFull}));19expectError(execaSync('unicorns', {stdin: booleanGeneratorFull}));20expectError(await execa('unicorns', {stdin: [booleanGeneratorFull]}));21expectError(execaSync('unicorns', {stdin: [booleanGeneratorFull]}));2223expectError(await execa('unicorns', {stdout: booleanGeneratorFull}));24expectError(execaSync('unicorns', {stdout: booleanGeneratorFull}));25expectError(await execa('unicorns', {stdout: [booleanGeneratorFull]}));26expectError(execaSync('unicorns', {stdout: [booleanGeneratorFull]}));2728expectError(await execa('unicorns', {stderr: booleanGeneratorFull}));29expectError(execaSync('unicorns', {stderr: booleanGeneratorFull}));30expectError(await execa('unicorns', {stderr: [booleanGeneratorFull]}));31expectError(execaSync('unicorns', {stderr: [booleanGeneratorFull]}));3233expectError(await execa('unicorns', {stdio: booleanGeneratorFull}));34expectError(execaSync('unicorns', {stdio: booleanGeneratorFull}));3536expectError(await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', booleanGeneratorFull]}));37expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', booleanGeneratorFull]}));38expectError(await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [booleanGeneratorFull]]}));39expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [booleanGeneratorFull]]}));40Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
lines 41–44why, one step back41expectTypeOf(booleanGeneratorFull).not.toBeAssignableTo<StdinOption>();42expectTypeOf(booleanGeneratorFull).not.toBeAssignableTo<StdinSyncOption>();43expectTypeOf([booleanGeneratorFull]).not.toBeAssignableTo<StdinOption>();44expectTypeOf([booleanGeneratorFull]).not.toBeAssignableTo<StdinSyncOption>();100% test coverage (#1018)ehmickybefore adoption9f65b86
line 45why, one step back45Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
lines 46–49why, one step back46expectTypeOf(booleanGeneratorFull).not.toBeAssignableTo<StdoutStderrOption>();47expectTypeOf(booleanGeneratorFull).not.toBeAssignableTo<StdoutStderrSyncOption>();48expectTypeOf([booleanGeneratorFull]).not.toBeAssignableTo<StdoutStderrOption>();49expectTypeOf([booleanGeneratorFull]).not.toBeAssignableTo<StdoutStderrSyncOption>();