Closed matthewbastien closed 1 month ago
Trying to set values on a mockGlobalModule() object does not set that value on the real global module. E.g. the following test will fail:
import { expect } from "chai"; import contextKeys from "../../src/contextKeys"; import { mockGlobalModule } from "../../MockUtils"; suite("test suite", () => { const mockedContextKeys = mockGlobalModule(contextKeys); test("can mock the contextKeys module", () => { mockedContextKeys.isActivated = true; expect(contextKeys.isActivated).to.be.true; // Error: expected undefined to be true }); });
This PR fixes that issue and adds a test to make sure it will continue working in the future.
Trying to set values on a mockGlobalModule() object does not set that value on the real global module. E.g. the following test will fail:
This PR fixes that issue and adds a test to make sure it will continue working in the future.