Skip to content

fix(browser): should not tip no test files found#900

Merged
9aoy merged 1 commit intomainfrom
browser-test-not-found
Jan 23, 2026
Merged

fix(browser): should not tip no test files found#900
9aoy merged 1 commit intomainfrom
browser-test-not-found

Conversation

@9aoy
Copy link
Copy Markdown
Collaborator

@9aoy 9aoy commented Jan 23, 2026

Summary

Should not tipno test files found when node tests existed.

Related Links

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings January 23, 2026 05:00
@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying rstest with  Cloudflare Pages  Cloudflare Pages

Latest commit: 2e64c69
Status: ✅  Deploy successful!
Preview URL: https://d5183588.rstest.pages.dev
Branch Preview URL: https://browser-test-not-found.rstest.pages.dev

View logs

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +1230 to +1236
if (!skipOnTestRunEnd) {
logger.log(
color[code ? 'red' : 'yellow'](
`No test files found, exiting with code ${code}.`,
),
);
}
Copy link

Copilot AI Jan 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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}.`,
),
);

Copilot uses AI. Check for mistakes.
);
}

if (code !== 0) {
Copy link

Copilot AI Jan 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
if (code !== 0) {
if (!skipOnTestRunEnd && code !== 0) {

Copilot uses AI. Check for mistakes.
@9aoy 9aoy merged commit b56991d into main Jan 23, 2026
23 of 25 checks passed
@9aoy 9aoy deleted the browser-test-not-found branch January 23, 2026 05:47
@9aoy 9aoy mentioned this pull request Jan 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants