Skip to content

Commit

Permalink
tests ~ add any STDERR output to test logs
Browse files Browse the repository at this point in the history
  • Loading branch information
rivy committed Aug 3, 2022
1 parent b473da6 commit 56744f1
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions test/integration.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ if (!process.env.npm_config_test_dist) {
const args = ['run', '--no-prompt', denoModulePath];
const options = { shell: true, encoding: 'utf-8' };

const { error, status, stdout } = spawn.sync(command, args, options);
const { error, status, stdout, stderr } = spawn.sync(command, args, options);

if (!(error === null && status === 0)) {
t.log({ denoModulePath, error, status, stdout });
t.log({ denoModulePath, error, status, stdout, stderr });
}

t.deepEqual({ error, status }, { error: null, status: 0 });
Expand All @@ -89,15 +89,15 @@ if (!process.env.npm_config_test_dist) {
const args = ['run', '--allow-all', script];
const options = { shell: true, encoding: 'utf-8' };

const { error, status, stdout } = spawn.sync(command, args, options);
const { error, status, stdout, stderr } = spawn.sync(command, args, options);

if (error === null && status === 0) {
t.log(
util.inspect(script, /* showHidden */ void 0, /* depth */ void 0, /* color */ true),
`(exit_status=${status})`
);
} else {
t.log({ script, error, status, stdout });
t.log({ script, error, status, stdout, stderr });
}

t.deepEqual({ error, status }, { error: null, status: 0 });
Expand Down Expand Up @@ -125,15 +125,15 @@ if (!process.env.npm_config_test_dist) {
const args = [script];
const options = { shell: true, encoding: 'utf-8' };

const { error, status, stdout } = spawn.sync(command, args, options);
const { error, status, stdout, stderr } = spawn.sync(command, args, options);

if (error === null && status === 0) {
t.log(
util.inspect(script, /* showHidden */ void 0, /* depth */ void 0, /* color */ true),
`(exit_status=${status})`
);
} else {
t.log({ script, error, status, stdout });
t.log({ script, error, status, stdout, stderr });
}

t.deepEqual({ error, status }, { error: null, status: 0 });
Expand Down Expand Up @@ -165,7 +165,7 @@ if (!process.env.npm_config_test_dist) {
const args = ['node_modules/ts-node/dist/bin.js', script];
const options = { shell: true, encoding: 'utf8' };

const { error, status, stdout } = spawn.sync(command, args, options);
const { error, status, stdout, stderr } = spawn.sync(command, args, options);

const basename = path.basename(file);
const extension = path.extname(file);
Expand All @@ -178,7 +178,8 @@ if (!process.env.npm_config_test_dist) {
`(exit_status=${status})`
);
} else {
t.log({ script, basename, name, extension, nameExtension, error, status, stdout });
t.log({ script, basename, name, extension, nameExtension });
t.log({ script, error, status, stdout, stderr });
}

t.deepEqual({ error, status }, { error: null, status: 0 });
Expand Down

0 comments on commit 56744f1

Please sign in to comment.