Skip to content
This repository was archived by the owner on Sep 19, 2025. It is now read-only.

Commit 6516457

Browse files
Add test error logging
1 parent 746798b commit 6516457

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

test/compiler.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ process.on('unhandledRejection', (e) => { throw e; });
3737
describe('compiler.jar', function () {
3838
it('should not be a snapshot build', async () => {
3939
const compiler = new Compiler({version: true});
40-
const {stdout} = await new Promise((resolve) =>
40+
const {exitCode, stdout, stderr} = await new Promise((resolve) =>
4141
compiler.run((exitCode, stdout, stderr) =>
4242
resolve({
4343
exitCode,
@@ -46,6 +46,10 @@ describe('compiler.jar', function () {
4646
})
4747
)
4848
);
49+
if (exitCode !== 0 || stderr) {
50+
console.error(`${stdout || ''}${stderr || ''}`);
51+
}
52+
expect(exitCode).toBe(0);
4953
let versionInfo = (stdout || '').match(compilerVersionMatch);
5054
expect(versionInfo).not.toBeNullish();
5155
versionInfo = versionInfo || [];
@@ -56,7 +60,7 @@ describe('compiler.jar', function () {
5660
it('version should be equal to the package major version', async () => {
5761
const compiler = new Compiler({version: true});
5862
const packageVer = new Semver(packageInfo.version);
59-
const {stdout} = await new Promise((resolve) =>
63+
const {exitCode, stdout, stderr} = await new Promise((resolve) =>
6064
compiler.run((exitCode, stdout, stderr) =>
6165
resolve({
6266
exitCode,
@@ -65,6 +69,10 @@ describe('compiler.jar', function () {
6569
})
6670
)
6771
);
72+
if (exitCode !== 0 || stderr) {
73+
console.error(`${stdout || ''}${stderr || ''}`);
74+
}
75+
expect(exitCode).toBe(0);
6876
let versionInfo = (stdout || '').match(compilerVersionMatch);
6977
expect(versionInfo).not.toBeNullish();
7078
versionInfo = versionInfo || [];

0 commit comments

Comments
 (0)