Skip to content
Myr

nested-pipe-subprocess.js

This file

Path

test/fixtures/nested-pipe-subprocess.js

16 lines · 477 bytes · JavaScript

Last changed by

Refactor test helpers for the `verbose` option (#1128)ehmickybefore adoption18d320f

History of this file

Take it

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

100% test coverage (#1018)ehmickybefore adoption9f65b86

line 1why, one step back
1#!/usr/bin/env node

Refactor test helpers for the `verbose` option (#1128)ehmickybefore adoption18d320f

line 2why, one step back
2import {execa, getOneMessage} from '../../index.js';

100% test coverage (#1018)ehmickybefore adoption9f65b86

line 3why, one step back
3

Refactor test helpers for the `verbose` option (#1128)ehmickybefore adoption18d320f

lines 4–5why, one step back
4const {file, commandArguments, options: {unpipe, ...options}} = await getOneMessage();
5const source = execa(file, commandArguments, options);

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 6–7why, one step back
6const destination = execa('stdin.js');
7const controller = new AbortController();

Refactor test helpers for the `verbose` option (#1128)ehmickybefore adoption18d320f

lines 8–9why, one step back
8const subprocess = source.pipe(destination, {unpipeSignal: controller.signal});
9if (unpipe) {

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 10–13why, one step back
10 controller.abort();
11 destination.stdin.end();12}13

Refactor test helpers for the `verbose` option (#1128)ehmickybefore adoption18d320f

lines 14–16why, one step back
14try {
15 await subprocess;16} catch {}