Skip to content

Commit 863d190

Browse files
committed
2 parents 36f4aed + 13bdfc4 commit 863d190

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

‎backend/tests/auth.test.js‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
const request = require('supertest');
22
const mongoose = require('mongoose');
33

4+
const JWT_SECRET =
5+
process.env.JWT_SECRET ||
6+
(process.env.NODE_ENV === "test" ? "ci_test_jwt_secret" : null);
7+
8+
if (!JWT_SECRET) {
9+
throw new Error("JWT_SECRET is not defined");
10+
}
11+
12+
413
jest.mock('resend', () => {
514
return {
615
Resend: jest.fn().mockImplementation(() => ({
@@ -82,4 +91,4 @@ describe('Auth API Security', () => {
8291
expect(res.statusCode).toBe(400);
8392
expect(res.body.error).toBeDefined();
8493
});
85-
});
94+
});

0 commit comments

Comments
 (0)