fix: inject the routing-observations reader instead of mocking the proxy module
The handler imported getRoutingObservations directly, so its test had to replace the whole "@better-ccflare/proxy" module via mock.module. Bun applies module mocks PROCESS-WIDE across file boundaries, so that mock also replaced the module the proxy package's own tests import: six of their assertions read through the mock's empty record instead of the real singleton they had just written to. The failure appears only when both test files run in one `bun test` invocation (a whole-repo run, or any invocation naming both paths) and is order-independent, so the package-scoped runs used during development stayed green and hid it. The handler now takes its reader as a parameter defaulting to the real getRoutingObservations, and the test passes fakes directly — no module mocking, no cross-suite coupling. Verified by running both files together in both orders: 12 pass, 0 fail (was 6 fail). Production behaviour is unchanged; callers use the default.
M
Matthias Breddin committed
0367cbde2c8b34e36837d33f2609b749204b7234
Parent: 3b6c984