Skip to content
Myr

duplex.test-d.ts

This file

Path

test-d/convert/duplex.test-d.ts

32 lines · 1.2 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.

100% test coverage (#1018)ehmickybefore adoption9f65b86

line 1why, one step back
1import type {Duplex} from 'node:stream';

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

line 2why, one step back
2import {expectTypeOf, expectError} from 'nz';

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 3–6why, one step back
3import {execa} from '../../index.js';
45const subprocess = execa('unicorns');6

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

line 7why, one step back
7expectTypeOf(subprocess.duplex()).toBe<Duplex>();

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 8–12why, one step back
8
9subprocess.duplex({from: 'stdout'});10subprocess.duplex({from: 'stderr'});11subprocess.duplex({from: 'all'});12subprocess.duplex({from: 'fd3'});

Add more type tests (#1117)ehmickybefore adoption077749d

line 13why, one step back
13subprocess.duplex({to: 'fd3'});

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 14–15why, one step back
14subprocess.duplex({from: 'stdout', to: 'stdin'});
15subprocess.duplex({from: 'stdout', to: 'fd3'});

Add more type tests (#1117)ehmickybefore adoption077749d

lines 16–17why, one step back
16expectError(subprocess.duplex({from: 'stdout' as string}));
17expectError(subprocess.duplex({to: 'fd3' as string}));

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 18–32why, one step back
18expectError(subprocess.duplex({from: 'stdin'}));
19expectError(subprocess.duplex({from: 'stderr', to: 'stdout'}));20expectError(subprocess.duplex({from: 'fd'}));21expectError(subprocess.duplex({from: 'fdNotANumber'}));22expectError(subprocess.duplex({to: 'fd'}));23expectError(subprocess.duplex({to: 'fdNotANumber'}));2425subprocess.duplex({binary: false});26expectError(subprocess.duplex({binary: 'false'}));2728subprocess.duplex({preserveNewlines: false});29expectError(subprocess.duplex({preserveNewlines: 'false'}));3031expectError(subprocess.duplex('stdout'));32expectError(subprocess.duplex({other: 'stdout'}));