From a08c6c57dccc0151a00f18036c2969c9fd3e4981 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Tue, 27 Oct 2026 13:47:19 -0700 Subject: [PATCH] test(boy): mock the audio worklet in the element test 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 --- js/moq-boy/src/element.test.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/js/moq-boy/src/element.test.ts b/js/moq-boy/src/element.test.ts index 9264c361763..550189fd4d0 100644 --- a/js/moq-boy/src/element.test.ts +++ b/js/moq-boy/src/element.test.ts @@ -3,6 +3,9 @@ import { expect, mock, test } from "bun:test"; // The UI renders into a shadow root, which the test runner has no DOM for. mock.module("solid-js/web", () => ({ render: () => () => {} })); mock.module("./ui/element.tsx", () => ({ BoyUI: () => null })); +// Bun cannot load the blob-URL worklet import used by the audio decoder. Mock it here rather than +// relying on game.test.ts, since that mock only applies when its file happens to run first. +mock.module("../../watch/src/audio/render-worklet.ts?worklet", () => ({ default: async () => "blob:fake-render" })); const registry = new Map(); globalThis.HTMLElement = class {