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 fileTake it
The walk stopped after 200 commits: lines older than 9f65b86 point at it.
100% test coverage (#1018)ehmickybefore adoption9f65b86
line 1why, one step back1import type {Duplex} from 'node:stream';Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
line 2why, one step back2import {expectTypeOf, expectError} from 'nz';100% test coverage (#1018)ehmickybefore adoption9f65b86
lines 3–6why, one step back3import {execa} from '../../index.js';45const subprocess = execa('unicorns');6Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
line 7why, one step back7expectTypeOf(subprocess.duplex()).toBe<Duplex>();100% test coverage (#1018)ehmickybefore adoption9f65b86
lines 8–12why, one step back89subprocess.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 back13subprocess.duplex({to: 'fd3'});100% test coverage (#1018)ehmickybefore adoption9f65b86
lines 14–15why, one step back14subprocess.duplex({from: 'stdout', to: 'stdin'});15subprocess.duplex({from: 'stdout', to: 'fd3'});Add more type tests (#1117)ehmickybefore adoption077749d
lines 16–17why, one step back16expectError(subprocess.duplex({from: 'stdout' as string}));17expectError(subprocess.duplex({to: 'fd3' as string}));100% test coverage (#1018)ehmickybefore adoption9f65b86
lines 18–32why, one step back18expectError(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'}));