Skip to content
Myr

generator-string-full.test-d.ts

This file

Path

test-d/stdio/option/generator-string-full.test-d.ts

48 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–16why, 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 stringGeneratorFull = {12 * transform(line: string) {13 yield line;14 },15} as const;16

Type the `std*` generator transform `chunk` argument (#1247)Sindre Sorhusbefore adoption0a7b4f8

lines 17–20why, one step back
17await execa('unicorns', {stdin: stringGeneratorFull});
18execaSync('unicorns', {stdin: stringGeneratorFull});19await execa('unicorns', {stdin: [stringGeneratorFull]});20execaSync('unicorns', {stdin: [stringGeneratorFull]});

100% test coverage (#1018)ehmickybefore adoption9f65b86

line 21why, one step back
21

Type the `std*` generator transform `chunk` argument (#1247)Sindre Sorhusbefore adoption0a7b4f8

lines 22–25why, one step back
22await execa('unicorns', {stdout: stringGeneratorFull});
23execaSync('unicorns', {stdout: stringGeneratorFull});24await execa('unicorns', {stdout: [stringGeneratorFull]});25execaSync('unicorns', {stdout: [stringGeneratorFull]});

100% test coverage (#1018)ehmickybefore adoption9f65b86

line 26why, one step back
26

Type the `std*` generator transform `chunk` argument (#1247)Sindre Sorhusbefore adoption0a7b4f8

lines 27–30why, one step back
27await execa('unicorns', {stderr: stringGeneratorFull});
28execaSync('unicorns', {stderr: stringGeneratorFull});29await execa('unicorns', {stderr: [stringGeneratorFull]});30execaSync('unicorns', {stderr: [stringGeneratorFull]});

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 31–34why, one step back
31
32expectError(await execa('unicorns', {stdio: stringGeneratorFull}));33expectError(execaSync('unicorns', {stdio: stringGeneratorFull}));34

Type the `std*` generator transform `chunk` argument (#1247)Sindre Sorhusbefore adoption0a7b4f8

lines 35–38why, one step back
35await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', stringGeneratorFull]});
36execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', stringGeneratorFull]});37await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [stringGeneratorFull]]});38execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [stringGeneratorFull]]});

100% test coverage (#1018)ehmickybefore adoption9f65b86

line 39why, one step back
39

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

lines 40–43why, one step back
40expectTypeOf(stringGeneratorFull).toBeAssignableTo<StdinOption>();
41expectTypeOf(stringGeneratorFull).toBeAssignableTo<StdinSyncOption>();42[stringGeneratorFull] satisfies StdinOption;43[stringGeneratorFull] satisfies StdinSyncOption;

100% test coverage (#1018)ehmickybefore adoption9f65b86

line 44why, one step back
44

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

lines 45–48why, one step back
45expectTypeOf(stringGeneratorFull).toBeAssignableTo<StdoutStderrOption>();
46expectTypeOf(stringGeneratorFull).toBeAssignableTo<StdoutStderrSyncOption>();47[stringGeneratorFull] satisfies StdoutStderrOption;48[stringGeneratorFull] satisfies StdoutStderrSyncOption;