Skip to content

Commit

Permalink
[browser tests] Delay exit after test finish
Browse files Browse the repository at this point in the history
When running the suite in headless mode, it exits as soon as the mocha tests
are done executing. In some cases where there are lots of errors to report[1],
the final report did not have the chance to be printed-out, and so we were
left wondering about the details of what caused the failures.

[1]: basically the final pass/not passes/skip count as well as details about
the failed tests.

Signed-off-by: Marc Dumais <marc.dumais@ericsson.com>
  • Loading branch information
marcdumais-work committed Feb 9, 2023
1 parent 1f0d8e5 commit 8fbddb8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions dev-packages/cli/src/run-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ export default async function runTest(options: TestOptions): Promise<void> {
require('puppeteer-to-istanbul').write([...jsCoverage, ...cssCoverage]);
}
if (exit) {
// allow a bit of time to finish printing-out test results
await new Promise(resolve => setTimeout(resolve, 1000));
await testPage.close();
process.exit(failures > 0 ? 1 : 0);
}
Expand Down

0 comments on commit 8fbddb8

Please sign in to comment.