lines-main.test-d.ts
This file
Path
test-d/return/lines-main.test-d.ts
73 lines · 3.6 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.
Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
line 1why, one step back1import {expectTypeOf} from 'nz';100% test coverage (#1018)ehmickybefore adoption9f65b86
lines 2–9why, one step back2import {3 execa,4 execaSync,5 type ExecaError,6 type ExecaSyncError,7} from '../../index.js';89const linesResult = await execa('unicorns', {lines: true, all: true});Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
lines 10–14why, one step back10expectTypeOf(linesResult.stdout).toBe<string[]>();11expectTypeOf(linesResult.stdio[1]).toBe<string[]>();12expectTypeOf(linesResult.stderr).toBe<string[]>();13expectTypeOf(linesResult.stdio[2]).toBe<string[]>();14expectTypeOf(linesResult.all).toBe<string[]>();100% test coverage (#1018)ehmickybefore adoption9f65b86
lines 15–16why, one step back1516const linesBufferResult = await execa('unicorns', {lines: true, encoding: 'buffer', all: true});Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
lines 17–21why, one step back17expectTypeOf(linesBufferResult.stdout).toBe<Uint8Array>();18expectTypeOf(linesBufferResult.stdio[1]).toBe<Uint8Array>();19expectTypeOf(linesBufferResult.stderr).toBe<Uint8Array>();20expectTypeOf(linesBufferResult.stdio[2]).toBe<Uint8Array>();21expectTypeOf(linesBufferResult.all).toBe<Uint8Array>();100% test coverage (#1018)ehmickybefore adoption9f65b86
lines 22–23why, one step back2223const linesHexResult = await execa('unicorns', {lines: true, encoding: 'hex', all: true});Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
lines 24–28why, one step back24expectTypeOf(linesHexResult.stdout).toBe<string>();25expectTypeOf(linesHexResult.stdio[1]).toBe<string>();26expectTypeOf(linesHexResult.stderr).toBe<string>();27expectTypeOf(linesHexResult.stdio[2]).toBe<string>();28expectTypeOf(linesHexResult.all).toBe<string>();100% test coverage (#1018)ehmickybefore adoption9f65b86
lines 29–30why, one step back2930const linesFd3Result = await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 'pipe'], lines: true});Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
line 31why, one step back31expectTypeOf(linesFd3Result.stdio[3]).toBe<string[]>();100% test coverage (#1018)ehmickybefore adoption9f65b86
lines 32–33why, one step back3233const linesBufferFd3Result = await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 'pipe'], lines: true, encoding: 'buffer'});Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
line 34why, one step back34expectTypeOf(linesBufferFd3Result.stdio[3]).toBe<Uint8Array>();100% test coverage (#1018)ehmickybefore adoption9f65b86
lines 35–36why, one step back3536const execaLinesError = new Error('.') as ExecaError<{lines: true; all: true}>;Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
lines 37–41why, one step back37expectTypeOf(execaLinesError.stdout).toBe<string[]>();38expectTypeOf(execaLinesError.stdio[1]).toBe<string[]>();39expectTypeOf(execaLinesError.stderr).toBe<string[]>();40expectTypeOf(execaLinesError.stdio[2]).toBe<string[]>();41expectTypeOf(execaLinesError.all).toBe<string[]>();100% test coverage (#1018)ehmickybefore adoption9f65b86
lines 42–43why, one step back4243const execaLinesBufferError = new Error('.') as ExecaError<{lines: true; encoding: 'buffer'; all: true}>;Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
lines 44–48why, one step back44expectTypeOf(execaLinesBufferError.stdout).toBe<Uint8Array>();45expectTypeOf(execaLinesBufferError.stdio[1]).toBe<Uint8Array>();46expectTypeOf(execaLinesBufferError.stderr).toBe<Uint8Array>();47expectTypeOf(execaLinesBufferError.stdio[2]).toBe<Uint8Array>();48expectTypeOf(execaLinesBufferError.all).toBe<Uint8Array>();100% test coverage (#1018)ehmickybefore adoption9f65b86
lines 49–50why, one step back4950const linesResultSync = execaSync('unicorns', {lines: true, all: true});Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
lines 51–53why, one step back51expectTypeOf(linesResultSync.stdout).toBe<string[]>();52expectTypeOf(linesResultSync.stderr).toBe<string[]>();53expectTypeOf(linesResultSync.all).toBe<string[]>();100% test coverage (#1018)ehmickybefore adoption9f65b86
lines 54–55why, one step back5455const linesBufferResultSync = execaSync('unicorns', {lines: true, encoding: 'buffer', all: true});Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
lines 56–58why, one step back56expectTypeOf(linesBufferResultSync.stdout).toBe<Uint8Array>();57expectTypeOf(linesBufferResultSync.stderr).toBe<Uint8Array>();58expectTypeOf(linesBufferResultSync.all).toBe<Uint8Array>();100% test coverage (#1018)ehmickybefore adoption9f65b86
lines 59–60why, one step back5960const linesHexResultSync = execaSync('unicorns', {lines: true, encoding: 'hex', all: true});Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
lines 61–63why, one step back61expectTypeOf(linesHexResultSync.stdout).toBe<string>();62expectTypeOf(linesHexResultSync.stderr).toBe<string>();63expectTypeOf(linesHexResultSync.all).toBe<string>();100% test coverage (#1018)ehmickybefore adoption9f65b86
lines 64–65why, one step back6465const execaLinesErrorSync = new Error('.') as ExecaSyncError<{lines: true; all: true}>;Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
lines 66–68why, one step back66expectTypeOf(execaLinesErrorSync.stdout).toBe<string[]>();67expectTypeOf(execaLinesErrorSync.stderr).toBe<string[]>();68expectTypeOf(execaLinesErrorSync.all).toBe<string[]>();100% test coverage (#1018)ehmickybefore adoption9f65b86
lines 69–70why, one step back6970const execaLinesBufferErrorSync = new Error('.') as ExecaSyncError<{lines: true; encoding: 'buffer'; all: true}>;Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
lines 71–73why, one step back71expectTypeOf(execaLinesBufferErrorSync.stdout).toBe<Uint8Array>();72expectTypeOf(execaLinesBufferErrorSync.stderr).toBe<Uint8Array>();73expectTypeOf(execaLinesBufferErrorSync.all).toBe<Uint8Array>();