Skip to content

Commit

Permalink
feat: count timeout tests
Browse files Browse the repository at this point in the history
  • Loading branch information
darkskygit committed Dec 9, 2024
1 parent 6773f38 commit aa18846
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions packages/backend/server/scripts/copilot-cron-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,22 @@ async function runTest() {
);

const parser = new Parser();
test.stdout.pipe(parser);
test.stdout.on('data', data => {
console.log(data.toString());
parser.write(data);
});

test.on('close', _ => {
const failures = parser?.failures.filter(f => !!f.fullname);
const timeouts = parser?.failures.filter(f => !f.fullname);
const result = [
`${parser.results.pass} passed`,
`${parser.results.fail - timeouts.length} failed`,
`${timeouts.length} timeouts`,
`${parser.results.skip} skipped`,
];
const report = [
`Test finished with ${parser.results.pass} passed, ${parser.results.fail} failed, ${parser.results.skip} skipped.`,
`Test finished with ${result.join(', ')}.`,
failures?.length > 0
? `Failed tests: \n\n${failures.map(failure => `- ${failure.fullname}`).join('\n')}`
: '',
Expand Down

0 comments on commit aa18846

Please sign in to comment.