Repository navigation
test(mocks): export SAFE_MOCK_SESSION in next-auth mock and standardize auth test fixtures - #1799
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
@qalvinahmad is attempting to deploy a commit to the Gaurav's projects Team on Vercel. A member of the Team first needs to authorize it. |
| import { SAFE_MOCK_SESSION } from "../../tests/fixtures/mock-session"; | ||
| export { SAFE_MOCK_SESSION }; | ||
|
|
||
| export const SAFE_MOCK_SESSION = Object.freeze({ |
There was a problem hiding this comment.
Actually i was getting some errors with this... thats why i moved this to fixtures so please revert this change
There was a problem hiding this comment.
Moved the canonical session definition back to tests/fixtures/mock-session.ts and kept this mock re-exporting that shared fixture.
| }, | ||
| expires: "2099-01-01T00:00:00.000Z", | ||
| }); | ||
| export { SAFE_MOCK_SESSION } from "../../__mocks__/next-auth/index.js"; |
There was a problem hiding this comment.
Restored the frozen SAFE_MOCK_SESSION definition in the shared fixture as requested.
| * without any hardcoded production secrets, session keys, or private credentials. | ||
| */ | ||
| import { vi } from "vitest"; | ||
| import { SAFE_MOCK_SESSION } from "./next-auth/index.js"; |
There was a problem hiding this comment.
Import this from fixtures
There was a problem hiding this comment.
Updated __mocks__/auth.ts to import SAFE_MOCK_SESSION from the shared fixtures module.
| import NextAuth from "../__mocks__/next-auth"; | ||
| import { SAFE_MOCK_SESSION } from "./fixtures/mock-session"; | ||
| import NextAuth from "../__mocks__/next-auth/index.js"; | ||
| import { SAFE_MOCK_SESSION } from "../__mocks__/next-auth/index.js"; |
There was a problem hiding this comment.
Restored the original NextAuth mock and fixture imports in the audit test.
|
Go through this review |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Summary
Closes #1792
Validation