diff --git a/apps/backend/app.ts b/apps/backend/app.ts index 9324c32..4ac40de 100644 --- a/apps/backend/app.ts +++ b/apps/backend/app.ts @@ -73,4 +73,4 @@ const server = app.listen(port, () => { console.log(`listening on port: ${port}!`); }); -server.setTimeout(5000); +server.setTimeout(30000); diff --git a/tests/unit/config/server-timeout.test.ts b/tests/unit/config/server-timeout.test.ts new file mode 100644 index 0000000..d156f5b --- /dev/null +++ b/tests/unit/config/server-timeout.test.ts @@ -0,0 +1,15 @@ +import { readFileSync } from 'fs'; +import { resolve } from 'path'; + +describe('server timeout configuration', () => { + const appSource = readFileSync(resolve(__dirname, '../../../apps/backend/app.ts'), 'utf-8'); + + it('should set server timeout to at least 30 seconds', () => { + const match = appSource.match(/server\.setTimeout\((\d+)\)/); + expect(match).not.toBeNull(); + if (!match) return; + + const timeoutMs = Number(match[1]); + expect(timeoutMs).toBeGreaterThanOrEqual(30_000); + }); +});