Enable automatic reset of mock state

This commit is contained in:
2025-07-21 19:41:45 -04:00
parent 883dc9ef6e
commit 321e7a7fa9
2 changed files with 3 additions and 6 deletions

View File

@@ -110,7 +110,7 @@ const config = {
// reporters: undefined,
// Automatically reset mock state before every test
// resetMocks: false,
resetMocks: true,
// Reset the module registry before running each individual test
// resetModules: false,
@@ -119,7 +119,7 @@ const config = {
// resolver: undefined,
// Automatically restore mock state and implementation before every test
// restoreMocks: false,
restoreMocks: true,
// The root directory that Jest should scan for tests and modules within
// rootDir: undefined,

View File

@@ -8,12 +8,9 @@ describe("TimedApiBasedRepositoryLoader", () => {
let timedLoader: TimedApiBasedRepositoryLoader;
let spies: any;
beforeAll(() => {
beforeEach(() => {
jest.useFakeTimers();
jest.spyOn(global, "setTimeout");
});
beforeEach(() => {
resetGlobalFetchMockJson();
const mockLoader = new ApiBasedShuttleRepositoryLoader(