Skip to content

Commit

Permalink
testdbg
Browse files Browse the repository at this point in the history
  • Loading branch information
kwonoj committed Jul 28, 2022
1 parent dd6053b commit fe3837b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions test/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ module.exports = [
{
args: ["run", "test/fixtures/ts-error1/fail.ts"],
expect (code, stdout, stderr) {
console.log(stderr);
return code === 1 && stderr.toString().indexOf('fail.ts:2:1') !== -1;
}
},
Expand Down
12 changes: 9 additions & 3 deletions test/cli.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const { join } = require("path");
const cliTests = require("./cli.js");
const file = global.coverage ? "/../src/cli.js" : "/../dist/ncc/cli.js";

jest.setTimeout(20000);
jest.setTimeout(25000);

describe('cli', () => {
it.each(cliTests)('should execute ncc $args', async ({ args, env, expect: e, timeout }) => {
Expand All @@ -13,8 +13,14 @@ describe('cli', () => {
env: { ...process.env, ...env },
});
let stderr = "", stdout = "";
ps.stderr.on("data", chunk => stderr += chunk.toString());
ps.stdout.on("data", chunk => stdout += chunk.toString());
ps.stderr.on("data", chunk => {
console.log(chunk.toString())
stderr += chunk.toString()
});
ps.stdout.on("data", chunk => {
console.log(chunk.toString())
stdout += chunk.toString()
});
const expected = e ?? { code: 0 };
let timedOut = false;
if (timeout)
Expand Down

0 comments on commit fe3837b

Please sign in to comment.