no-buffer-main.test-d.ts
This file
Path
test-d/return/no-buffer-main.test-d.ts
44 lines · 2.0 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 {Readable, Writable} from 'node:stream';Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
line 2why, one step back2import {expectTypeOf} from 'nz';100% test coverage (#1018)ehmickybefore adoption9f65b86
lines 3–10why, one step back3import {4 execa,5 execaSync,6 type ExecaError,7 type ExecaSyncError,8} from '../../index.js';910const noBufferSubprocess = execa('unicorns', {buffer: false, all: true});Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
lines 11–17why, one step back11expectTypeOf(noBufferSubprocess.stdin).toBe<Writable>();12expectTypeOf(noBufferSubprocess.stdio[0]).toBe<Writable>();13expectTypeOf(noBufferSubprocess.stdout).toBe<Readable>();14expectTypeOf(noBufferSubprocess.stdio[1]).toBe<Readable>();15expectTypeOf(noBufferSubprocess.stderr).toBe<Readable>();16expectTypeOf(noBufferSubprocess.stdio[2]).toBe<Readable>();17expectTypeOf(noBufferSubprocess.all).toBe<Readable>();100% test coverage (#1018)ehmickybefore adoption9f65b86
lines 18–19why, one step back1819const noBufferResult = await noBufferSubprocess;Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
lines 20–24why, one step back20expectTypeOf(noBufferResult.stdout).toBe<undefined>();21expectTypeOf(noBufferResult.stdio[1]).toBe<undefined>();22expectTypeOf(noBufferResult.stderr).toBe<undefined>();23expectTypeOf(noBufferResult.stdio[2]).toBe<undefined>();24expectTypeOf(noBufferResult.all).toBe<undefined>();100% test coverage (#1018)ehmickybefore adoption9f65b86
lines 25–26why, one step back2526const noBufferResultSync = execaSync('unicorns', {buffer: false, all: true});Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
lines 27–29why, one step back27expectTypeOf(noBufferResultSync.stdout).toBe<undefined>();28expectTypeOf(noBufferResultSync.stderr).toBe<undefined>();29expectTypeOf(noBufferResultSync.all).toBe<undefined>();100% test coverage (#1018)ehmickybefore adoption9f65b86
lines 30–31why, one step back3031const noBuffer3Result = await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 'pipe'], buffer: false});Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
line 32why, one step back32expectTypeOf(noBuffer3Result.stdio[3]).toBe<undefined>();100% test coverage (#1018)ehmickybefore adoption9f65b86
lines 33–34why, one step back3334const noBufferError = new Error('.') as ExecaError<{buffer: false; all: true}>;Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
lines 35–39why, one step back35expectTypeOf(noBufferError.stdout).toBe<undefined>();36expectTypeOf(noBufferError.stdio[1]).toBe<undefined>();37expectTypeOf(noBufferError.stderr).toBe<undefined>();38expectTypeOf(noBufferError.stdio[2]).toBe<undefined>();39expectTypeOf(noBufferError.all).toBe<undefined>();100% test coverage (#1018)ehmickybefore adoption9f65b86
lines 40–41why, one step back4041const noBufferErrorSync = new Error('.') as ExecaSyncError<{buffer: false; all: true}>;Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
lines 42–44why, one step back42expectTypeOf(noBufferErrorSync.stdout).toBe<undefined>();43expectTypeOf(noBufferErrorSync.stderr).toBe<undefined>();44expectTypeOf(noBufferErrorSync.all).toBe<undefined>();