Skip to content

fix(web): browser test mocks no longer hang the suite - #155

Merged
nullStack65 merged 1 commit into
release/native-0.1.10from
fix/web-browser-vi-mock
Nov 21, 2026
Merged

nullStack65 merged 1 commit into
release/native-0.1.10from
fix/web-browser-vi-mock

Conversation

@nullStack65

Copy link
Copy Markdown
Owner

The full web browser test project ended every run with one unhandled rejection, [vitest] There was an error when mocking a module, and two files that never collected a test. The mocker wraps the real cause in that message, so the failure looked like one shared loader bug.

Two test files were each stuck loading for a different reason:

  • ThreadRelationshipsControl.browser.test.tsx replaced the environments module with a factory returning only the two hooks the test drives. The component reaches useSettings through threads.ts, and useSettings value-imports useEnvironments, so the browser rejected the module for the missing export. The mock now keeps the real module and overrides only those two hooks.
  • ChatMarkdown.permissions.browser.test.tsx awaited threads.ts from inside the factory that mocks use-atom-command. threads.ts reaches useSettings, which imports use-atom-command, so the factory waited on a module that was waiting on the factory and never resolved. The factory now reads threadEnvironment from a module-scope import.

After the fix the browser project loads all 241 files and the unhandled rejection is gone. Both changed files pass on their own (13 and 8 tests), and vp run typecheck in apps/web exits 0. A full run on a heavily loaded machine still reports 18 failures in four files this change does not touch (Sidebar, useInlineActionConfirm, CloudVoiceConfiguration, word-document), all timeouts or assertion failures rather than loader errors.

Deploy: none

Model: grok-4.7
Task: fix the browser test project vi.mock loader failure
Agent: magpie

🤖 Generated with Claude Code

Two browser tests never finished loading, and vitest reports that only as a
generic "error when mocking a module" once the run ends.

ThreadRelationshipsControl replaced the environments module with two exports,
so useEnvironments, which useSettings imports through threads.ts, was missing
and the browser rejected the module. The mock now keeps the real module and
overrides only the two hooks the test drives.

ChatMarkdown's command mock awaited threads.ts from inside the factory that
mocks use-atom-command, which useSettings imports while threads.ts is still
evaluating, so the factory never resolved and the file collected no tests.
The factory now reads threadEnvironment from a module-scope import.

Model: grok-4.7
Task: fix the browser test project vi.mock loader failure
Agent: magpie
Lane: magpie
Harness: t3/claude-code
Model-family: Grok
Model-generation: 4.7

Co-Authored-By: Claude Code <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 21, 2026

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@nullStack65
nullStack65 merged commit 3cf032f into release/native-0.1.10 Nov 21, 2026
3 of 4 checks passed
@nullStack65
nullStack65 deleted the fix/web-browser-vi-mock branch November 21, 2026 01:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant