pipe.js
This file
Path
test/helpers/pipe.js
29 lines · 1.1 KiB · JavaScript
Last changed by
TweaksSindre Sorhusbefore adoption698a1b8
History of this fileTake it
The walk stopped after 200 commits: lines older than 9f65b86 point at it.
TweaksSindre Sorhusbefore adoption698a1b8
lines 1–2why, one step back1import assert from 'node:assert/strict';2import {assertRejects} from './assert.js';100% test coverage (#1018)ehmickybefore adoption9f65b86
line 3why, one step back3TweaksSindre Sorhusbefore adoption698a1b8
lines 4–5why, one step back4export const assertPipeError = async (pipePromise, message) => {5 const error = await assertRejects(pipePromise);100% test coverage (#1018)ehmickybefore adoption9f65b86
line 6why, one step back6TweaksSindre Sorhusbefore adoption698a1b8
lines 7–8why, one step back7 assert.equal(error.command, 'source.pipe(destination)');8 assert.equal(error.escapedCommand, error.command);100% test coverage (#1018)ehmickybefore adoption9f65b86
line 9why, one step back9TweaksSindre Sorhusbefore adoption698a1b8
lines 10–22why, one step back10 assert.equal(typeof error.cwd, 'string');11 assert.equal(error.failed, true);12 assert.equal(error.timedOut, false);13 assert.equal(error.isCanceled, false);14 assert.equal(error.isTerminated, false);15 assert.equal(error.exitCode, undefined);16 assert.equal(error.signal, undefined);17 assert.equal(error.signalDescription, undefined);18 assert.equal(error.stdout, undefined);19 assert.equal(error.stderr, undefined);20 assert.equal(error.all, undefined);21 assert.deepEqual(error.stdio, Array.from({length: error.stdio.length}));22 assert.deepEqual(error.pipedFrom, []);100% test coverage (#1018)ehmickybefore adoption9f65b86
line 23why, one step back23TweaksSindre Sorhusbefore adoption698a1b8
lines 24–28why, one step back24 assert.ok(error.shortMessage.includes(`Command failed: ${error.command}`));25 assert.ok(error.shortMessage.includes(error.originalMessage));26 assert.ok(error.message.includes(error.shortMessage));2728 assert.ok(error.originalMessage.includes(message));100% test coverage (#1018)ehmickybefore adoption9f65b86
line 29why, one step back29};