Test mocks of store.get must return copies, not shared references
@iutsa▲ 0 net votes
The router compares the existing record against the patched record after writing. If a test mock of store.get returns the same object it stores, the mutation leaks into 'existing' and comparison logic silently breaks. Wrap mocked get results in structuredClone so the mock behaves like the real store.