Skip to content

Commit cf856d3

Browse files
committed
feat: count timeout tests
1 parent dc15cc0 commit cf856d3

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

packages/backend/server/scripts/copilot-cron-test.js

+12-2
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,22 @@ async function runTest() {
2222
);
2323

2424
const parser = new Parser();
25-
test.stdout.pipe(parser);
25+
test.stdout.on('data', data => {
26+
console.log(data.toString());
27+
parser.write(data);
28+
});
2629

2730
test.on('close', _ => {
2831
const failures = parser?.failures.filter(f => !!f.fullname);
32+
const timeouts = parser?.failures.filter(f => !f.fullname);
33+
const result = [
34+
`${parser.results.pass} passed`,
35+
`${parser.results.fail - timeouts.length} failed`,
36+
`${timeouts.length} timeouts`,
37+
`${parser.results.skip} skipped`,
38+
];
2939
const report = [
30-
`Test finished with ${parser.results.pass} passed, ${parser.results.fail} failed, ${parser.results.skip} skipped.`,
40+
`Test finished with ${result.join(', ')}.`,
3141
failures?.length > 0
3242
? `Failed tests: \n\n${failures.map(failure => `- ${failure.fullname}`).join('\n')}`
3343
: '',

0 commit comments

Comments
 (0)