Skip to content
Myr

pipe.js

This file

Path

test/helpers/pipe.js

29 lines · 1.1 KiB · JavaScript

Last changed by

TweaksSindre Sorhusbefore adoption698a1b8

History of this file

Take it

The walk stopped after 200 commits: lines older than 9f65b86 point at it.

TweaksSindre Sorhusbefore adoption698a1b8

lines 1–2why, one step back
1import assert from 'node:assert/strict';
2import {assertRejects} from './assert.js';

100% test coverage (#1018)ehmickybefore adoption9f65b86

line 3why, one step back
3

TweaksSindre Sorhusbefore adoption698a1b8

lines 4–5why, one step back
4export const assertPipeError = async (pipePromise, message) => {
5 const error = await assertRejects(pipePromise);

100% test coverage (#1018)ehmickybefore adoption9f65b86

line 6why, one step back
6

TweaksSindre Sorhusbefore adoption698a1b8

lines 7–8why, one step back
7 assert.equal(error.command, 'source.pipe(destination)');
8 assert.equal(error.escapedCommand, error.command);

100% test coverage (#1018)ehmickybefore adoption9f65b86

line 9why, one step back
9

TweaksSindre Sorhusbefore adoption698a1b8

lines 10–22why, one step back
10 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 back
23

TweaksSindre Sorhusbefore adoption698a1b8

lines 24–28why, one step back
24 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 back
29};