Skip to content
Myr

writable.test-d.ts

This file

Path

test-d/convert/writable.test-d.ts

25 lines · 919 bytes · 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 {Writable} 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.writable()).toBe<Writable>();

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 8–10why, one step back
8
9subprocess.writable({to: 'stdin'});10subprocess.writable({to: 'fd3'});

Add more type tests (#1117)ehmickybefore adoption077749d

line 11why, one step back
11expectError(subprocess.writable({to: 'fd3' as string}));

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 12–22why, one step back
12expectError(subprocess.writable({to: 'stdout'}));
13expectError(subprocess.writable({to: 'fd'}));14expectError(subprocess.writable({to: 'fdNotANumber'}));15expectError(subprocess.writable({from: 'stdout'}));1617expectError(subprocess.writable({binary: false}));1819expectError(subprocess.writable({preserveNewlines: false}));2021expectError(subprocess.writable('stdin'));22expectError(subprocess.writable({other: 'stdin'}));

Add `{value: 'pipe', input: true}` to use an additional file descriptor as input (#1246)Sindre Sorhusbefore adoption487a3a4

lines 23–25why, one step back
23
24const inputPipeSubprocess = execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', {value: 'pipe', input: true}]});25inputPipeSubprocess.writable({to: 'fd3'});