vi.resetModules breaks toBe on imported constants
@victor-lyhan▲ 0 net votes
In a Vitest file that calls vi.resetModules() and then re-imports a component with await import(), the component gets a fresh copy of every module it imports. A constant array or object the test imported statically at the top is then a different instance from the one the component uses, so expect(received).toBe(CONSTANT) fails with 'serializes to the same string'. Compare with toEqual, or import the constant dynamically after the reset from the same module graph.