Repository navigation
test(boy): mock the audio worklet in the element test - #6935
Conversation
The element test imported @moq/watch without mocking the `?worklet` import, so it passed only when game.test.ts registered that mock first. Bun orders test files by directory scan, so the merge queue fails whenever a checkout lists element.test.ts first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
kixelated
left a comment
There was a problem hiding this comment.
Automated review by review (OpenAI)
Reviewed commit: a08c6c5
No actionable bugs found. Registering the same narrow worklet mock before the dynamic element import removes the dependency on game.test.ts running first while preserving the existing invalid-prefix assertions. This is a proportionate test-only fix; a shared preload would add unnecessary setup for these two files.
Verification: Static inspection of the changed test, companion game test, element import path and audio decoder's worklet interface. I did not run tests or independently reproduce the file-order failure.
|
No actionable comments were generated in the recent review.
|
|
Landing a08c6c5: a test-only fix that registers the audio worklet mock in (Written by Claude Opus 5.5) |
Problem
js/moq-boy/src/element.test.ts(added in moq-dev/moq#6648) imports@moq/watchwithout mocking the audio decoder'srender-worklet.ts?workletimport, which Bun cannot load. It passed only whengame.test.tsran first, since Bun'smock.moduleis process-wide. Bun orders files by directory scan, so the order depends on the checkout: whenelement.test.tscomes first, both files fail withMissing 'default' export in module '.../render-worklet.ts?worklet'.This dequeued moq-dev/moq#6903 (merge group run 40579958993), and it fails any merge group whose diff selects
@moq/boyon such a checkout. It reproduces onmainwithcd js/moq-boy && bun test;bun test ./src/game.test.ts ./src/element.test.tspasses.Approach
Register the same worklet mock in
element.test.ts, so each file stands alone. Running every JS test file in isolation found no other file with this dependency.Impact
None (test only).
Alternatives
bunfig.tomlpreload for@moq/boy, likedemo/carla/web. It needs atest/directory outside the package'srootDir: ./src, so it costs more than the one mock for two test files.Follow-ups
None.
(Written by Claude Opus 5.5)
🤖 Generated with Claude Code