Skip to content

fix(browser): register Rstest API before browser setup files#966

Merged
fi3ework merged 1 commit intomainfrom
codex/fix-browser-setup-api-964
Feb 13, 2026
Merged

fix(browser): register Rstest API before browser setup files#966
fi3ework merged 1 commit intomainfrom
codex/fix-browser-setup-api-964

Conversation

@fi3ework
Copy link
Copy Markdown
Member

@fi3ework fi3ework commented Feb 13, 2026

Summary

Fixes #964 by aligning browser-mode setup execution order with worker runtime semantics.

  • In browser client entry, setup files are now loaded after createRstestRuntime so globalThis.RSTEST_API is already available.
  • Applied the same order in both run and collect modes.
  • Added e2e regression coverage for using beforeEach from @rstest/core inside browser setup files.

Why

Previously browser mode loaded setup files before runtime initialization, so calling beforeEach/other Rstest APIs inside setup could throw:

Rstest API '<name>' is not registered yet.

Verification

  • cd e2e && pnpm rstest browser-mode/setup.test.ts
  • cd e2e && pnpm rstest browser-mode/list.test.ts
  • pnpm --filter @rstest/browser typecheck

@fi3ework fi3ework force-pushed the codex/fix-browser-setup-api-964 branch from 0b8c836 to de0921b Compare February 13, 2026 18:10
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0b8c8367bb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@fi3ework fi3ework enabled auto-merge (squash) February 13, 2026 18:19
@fi3ework fi3ework merged commit 5e0d0c3 into main Feb 13, 2026
16 of 18 checks passed
@fi3ework fi3ework deleted the codex/fix-browser-setup-api-964 branch February 13, 2026 19:26
@9aoy 9aoy mentioned this pull request Feb 14, 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.

[Bug]: Browser mode does not register Rstest API

1 participant