Skip to content

Commit

Permalink
dx: improve error output when a CommandAcceptanceTest spawned command…
Browse files Browse the repository at this point in the history
… exits prematurely
  • Loading branch information
davewasmer committed Sep 14, 2017
1 parent 39cf01f commit 3c815e6
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/test/command-acceptance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,14 @@ export default class CommandAcceptanceTest {
this.spawnedCommand.on('error', reject);
this.spawnedCommand.on('close', () => {
this.cleanup();
reject(new Error('Spawned command exited without satisfying checkOutput'));
let message = 'Spawned command exited without satisfying checkOutput\n';
message += dedent`
====> stdout:
${ stdoutBuffer }
====> stderr:
${ stderrBuffer }
`;
reject(new Error(message));
});

// Poll periodically to check the results
Expand Down

0 comments on commit 3c815e6

Please sign in to comment.