mirror of
https://github.com/usetrmnl/trmnl-home-assistant.git
synced 2026-04-29 13:44:17 -07:00
Bun's mock.module() is global and hoisted — it replaces modules for ALL test files in the same process regardless of mock.restore() timing. This caused byos-auth, scheduleStore, and dithering tests to alternate between pass and fail depending on file load order. Replaced mock.module() with constructor dependency injection on both HttpRouter and Browser classes. Tests now pass mock implementations via constructor parameters, eliminating cross-file contamination entirely. Also installed ImageMagick 7 Q16-HDRI in CI (docker cp from production image) and replaced describe.skip with runtime IM7 detection so the 33 dithering tests now run in CI instead of being permanently skipped. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>