Skip to content

Commit b33e1c5

Browse files
committed
log for hanging
1 parent 02d0c26 commit b33e1c5

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

test/TestCases.template.js

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ const describeCases = config => {
7878
category.name,
7979
testName
8080
);
81+
const log = [];
8182
const options = {
8283
context: casesPath,
8384
entry: "./" + category.name + "/" + testName + "/index",
@@ -160,15 +161,24 @@ const describeCases = config => {
160161
);
161162
});
162163
});
163-
})
164+
}, new webpack.ProgressPlugin((...args) => {
165+
log.push(args);
166+
}))
164167
};
165168
it(
166169
testName + " should compile",
167170
done => {
168-
process.stdout.write(`START ${config.name} ${category.name} ${testName}\n`);
171+
const timeout = setTimeout(() => {
172+
process.stdout.write(`\n\nHANGING ${config.name} ${category.name} ${testName}\n`);
173+
for(const line of log) {
174+
process.stdout.write(line.join(" ") + "\n");
175+
}
176+
process.stdout.write(`\n\n\n`);
177+
done(new Error("Compilation is hanging"));
178+
}, 50000);
169179
const exportedTests = [];
170180
webpack(options, (err, stats) => {
171-
process.stdout.write(`COMP ${config.name} ${category.name} ${testName}\n`);
181+
clearTimeout(timeout);
172182
if (err) done(err);
173183
const statOptions = Stats.presetToOptions("verbose");
174184
statOptions.colors = false;
@@ -251,15 +261,7 @@ const describeCases = config => {
251261
jasmine
252262
.getEnv()
253263
.execute([asyncSuite.id], asyncSuite)
254-
.then(() => {
255-
process.stdout.write(`SUCC ${config.name} ${category.name} ${testName}\n`);
256-
done();
257-
}, e => {
258-
process.stdout.write(`COMP ${config.name} ${category.name} ${testName}\n`);
259-
process.stdout.write(`FAIL ${config.name} ${category.name} ${testName}\n`);
260-
done(e);
261-
});
262-
process.stdout.write(`COMP ${config.name} ${category.name} ${testName}\n`);
264+
.then(done, done);
263265
});
264266
},
265267
60000

0 commit comments

Comments
 (0)