fix(browser): should not tip no test files found#900
Conversation
Deploying rstest with
|
| Latest commit: |
2e64c69
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://d5183588.rstest.pages.dev |
| Branch Preview URL: | https://browser-test-not-found.rstest.pages.dev |
There was a problem hiding this comment.
Pull request overview
Suppress misleading “No test files found” output from the browser runner when running in a unified node+browser test run.
Changes:
- Gate the browser-mode “No test files found, exiting with code …” log behind
skipOnTestRunEnd.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if (!skipOnTestRunEnd) { | ||
| logger.log( | ||
| color[code ? 'red' : 'yellow']( | ||
| `No test files found, exiting with code ${code}.`, | ||
| ), | ||
| ); | ||
| } |
There was a problem hiding this comment.
skipOnTestRunEnd is documented as only skipping the reporter onTestRunEnd hook (see packages/core/src/types/browser.ts). With this change it also affects user-facing logging for the no-tests case; please update the option documentation (or introduce a more explicitly named option) so callers understand the broader behavior.
| if (!skipOnTestRunEnd) { | |
| logger.log( | |
| color[code ? 'red' : 'yellow']( | |
| `No test files found, exiting with code ${code}.`, | |
| ), | |
| ); | |
| } | |
| logger.log( | |
| color[code ? 'red' : 'yellow']( | |
| `No test files found, exiting with code ${code}.`, | |
| ), | |
| ); |
| ); | ||
| } | ||
|
|
||
| if (code !== 0) { |
There was a problem hiding this comment.
When skipOnTestRunEnd is true, this suppresses the "No test files found" log even when code is 1 (default passWithNoTests: false). That can result in an unexplained non-zero process.exitCode in unified runs. Consider still logging when code !== 0 and/or skipping ensureProcessExitCode(code) when skipOnTestRunEnd is true so the unified runner can handle no-tests reporting/exit status.
| if (code !== 0) { | |
| if (!skipOnTestRunEnd && code !== 0) { |
Summary
Should not tip
no test files foundwhen node tests existed.Related Links
Checklist