Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion tests/server.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,16 @@ describe('utilities/server', () => {
);
});

// Verify server returns 404 for unknown routes
test('server responds with 404 for unknown routes',async()=>{
const serverInstance=await startServer({port:3005},config,{});
const response=await fetch(`${serverInstance.local}/unknown`);
expect(response.status).toBe(404);
})
})

// Make sure the server logs requests by default.
test('log requests to the server by default', async () => {
test('do not log requests when request logging is disabled', async () => {
const consoleSpy = vi.spyOn(logger, 'http');
const address = await startServer({ port: 3004 }, config, {
'--no-request-logging': true,
Expand Down