Skip to content
Myr

max-buffer.js

This file

Path

test/helpers/max-buffer.js

11 lines · 498 bytes · 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

line 1why, one step back
1import assert from 'node:assert/strict';

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 2–5why, one step back
2import {execa, execaSync} from '../../index.js';
34export const maxBuffer = 10;5

TweaksSindre Sorhusbefore adoption698a1b8

line 6why, one step back
6export const assertErrorMessage = (shortMessage, {execaMethod = execa, length = maxBuffer, fdNumber = 1, unit = 'characters'} = {}) => {

Fix `maxBuffer` being ignored or wrongly appliedSindre Sorhusbefore adoption9547e51

line 7why, one step back
7 const expectedUnit = execaMethod === execaSync ? 'bytes' : unit;

TweaksSindre Sorhusbefore adoption698a1b8

line 8why, one step back
8 assert.ok(shortMessage.includes(`${STREAM_NAMES[fdNumber]} was larger than ${length} ${expectedUnit}`));

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 9–11why, one step back
9};
1011const STREAM_NAMES = ['stdin', 'stdout', 'stderr', 'stdio[3]'];