Skip to content

Allow child processes to inherit stdio streams #1322

@jamestalmage

Description

@jamestalmage

When writing native-stream-type, I had to abandon AVA as my test runner because it hijacked the native stdio streams (which I needed access to for testing).

While we have good reason for doing this with the default reporter, I don't see why we need to for the verbose reporter (and maybe even tap).

For those reporters, we could just fork like so:

// verbose
childProcess.fork(path, args, {
  stdio: 'inherit'
});

// tap
childProcess.fork(path, args, {
  stdio: [process.stdin, process.stderr, process.stderr]
});

The verbose reporter would allow test processes to fully inherit all streams from the parent - ideal for my situation.

The tap reporter would still need to redirect all output from the child process to stderr in the parent, but at least you've still got native TTY streams in the child then.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions