Refactor: Update mocks in test files for improved structure and clarity
All checks were successful
Deploy to Test Environment / deploy-to-test (push) Successful in 7m4s
All checks were successful
Deploy to Test Environment / deploy-to-test (push) Successful in 7m4s
This commit is contained in:
@@ -35,18 +35,23 @@ const { mockedDb } = vi.hoisted(() => {
|
||||
getAllBrands: vi.fn(),
|
||||
deleteFlyer: vi.fn(),
|
||||
},
|
||||
recipeRepo: {
|
||||
deleteRecipe: vi.fn(),
|
||||
},
|
||||
userRepo: {
|
||||
findUserProfileById: vi.fn(),
|
||||
deleteUserById: vi.fn(),
|
||||
},
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
vi.mock('../services/db/index.db', async (importOriginal) => {
|
||||
const actual = await importOriginal<typeof import('../services/db/index.db')>();
|
||||
return {
|
||||
...actual,
|
||||
adminRepo: mockedDb.adminRepo,
|
||||
flyerRepo: mockedDb.flyerRepo,
|
||||
};
|
||||
});
|
||||
vi.mock('../services/db/index.db', () => ({
|
||||
adminRepo: mockedDb.adminRepo,
|
||||
flyerRepo: mockedDb.flyerRepo,
|
||||
recipeRepo: mockedDb.recipeRepo,
|
||||
userRepo: mockedDb.userRepo,
|
||||
}));
|
||||
|
||||
// Mock other dependencies
|
||||
vi.mock('../services/db/recipe.db');
|
||||
|
||||
Reference in New Issue
Block a user