Skip to content
This repository was archived by the owner on Aug 8, 2020. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const through = require('through2');
const dargs = require('dargs');
const resolveCwd = require('resolve-cwd');
const execa = require('execa');
const fs = require('fs');

const BINARY = require.resolve('ava/cli.js');

Expand Down Expand Up @@ -50,6 +51,11 @@ module.exports = options => {
subprocess.stderr.pipe(process.stderr);
}

if (options.outputFile) {
const fileStream = fs.createWriteStream(options.outputFile);
subprocess.stdout.pipe(fileStream);
}

try {
await subprocess;
callback();
Expand Down
7 changes: 7 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,10 @@ Type: `boolean`<br>
Default: `false`

Run AVA with [`nyc`](https://github.com/istanbuljs/nyc). You must have `nyc` as a devDependency. `nyc` [options](https://github.com/istanbuljs/nyc#configuring-nyc) can be defined in package.json.

#### outputFile

Type: `string`<br>
Default: `undefined`

Store a copy of the stdout of AVA as a file. Example: `tests/output/tapOutput.txt`