fix tests
This commit is contained in:
parent
9fa403f2b7
commit
343cbf0409
2 changed files with 10 additions and 3 deletions
|
|
@ -8,6 +8,7 @@ import { initializeServices } from "./index.js";
|
|||
// Mock the onboarding module
|
||||
vi.mock("../onboarding.js", () => ({
|
||||
initializeWithOnboarding: vi.fn().mockResolvedValue({ wasOnboarded: false }),
|
||||
createOrUpdateConfig: vi.fn().mockResolvedValue(undefined),
|
||||
}));
|
||||
|
||||
// Mock auth module
|
||||
|
|
|
|||
|
|
@ -11,9 +11,15 @@ vi.mock("../auth/workos.js", () => ({
|
|||
isAuthenticatedConfig: vi.fn(),
|
||||
}));
|
||||
|
||||
vi.mock("node-machine-id", () => ({
|
||||
machineIdSync: vi.fn(() => "test-machine-id"),
|
||||
}));
|
||||
vi.mock("node-machine-id", () => {
|
||||
const mockFn = vi.fn(() => "test-machine-id");
|
||||
return {
|
||||
default: {
|
||||
machineIdSync: mockFn,
|
||||
},
|
||||
machineIdSync: mockFn,
|
||||
};
|
||||
});
|
||||
|
||||
// Import after mocks are set up
|
||||
import { loadAuthConfig, isAuthenticatedConfig } from "../auth/workos.js";
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue