fix: explicit JWT_SECRET in process env + correct 404 test
All checks were successful
Deploy API Server / build-and-deploy (push) Successful in 50s

This commit is contained in:
wangdl 2026-06-19 22:39:52 +08:00
parent 6a044fe29b
commit d57d9e009e
2 changed files with 6 additions and 3 deletions

View File

@ -101,7 +101,9 @@ function envForProcess(baseEnv: NodeJS.ProcessEnv): NodeJS.ProcessEnv {
DEEPSEEK_API_KEY: 'sk-test', DEEPSEEK_API_KEY: 'sk-test',
STORAGE_DRIVER: 'local', STORAGE_DRIVER: 'local',
ENABLE_SWAGGER: 'false', ENABLE_SWAGGER: 'false',
// No Bull Board in test JWT_SECRET: baseEnv.JWT_SECRET || 'test-integration-secret',
JWT_ACCESS_EXPIRES_IN: '1h',
CREDENTIAL_ENCRYPTION_KEY: baseEnv.CREDENTIAL_ENCRYPTION_KEY || '0123456789abcdef0123456789abcdef',
}; };
} }

View File

@ -232,11 +232,12 @@ describe('API E2E: Active Recall', () => {
expect(res.status).toBe(401); expect(res.status).toBe(401);
}); });
it('404 不存在的 Question', async () => { it('不存在的 Question 返回 404', async () => {
const res = await httpPost('/api/active-recalls/nonexistent-id/submit', { const res = await httpPost('/api/active-recalls/nonexistent-id/submit', {
answerText: 'A', answerText: 'A',
}, userToken); }, userToken);
expect([403, 404]).toContain(res.status); // Service throws NotFoundException → 404
expect(res.status).toBe(404);
}); });
}); });