Skip to content

Commit

Permalink
feat: Updated test/api.test.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
sweep-ai[bot] authored Sep 24, 2023
1 parent d3d256e commit 07d838c
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions test/api.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,37 @@ describe('Fastify API tests', () => {
server.close();
});

test('GET /api', async () => {
const response = await server.inject({
method: 'GET',
url: '/api',
});

expect(response.statusCode).toBe(200);
});

test('GET /api/hello', async () => {
const response = await server.inject({
method: 'GET',
url: '/api/hello',
});

expect(response.statusCode).toBe(200);
});

test('GET /api/ping', async () => {
const response = await server.inject({
method: 'GET',
url: '/api/ping',
});

expect(response.statusCode).toBe(200);
expect(response.json()).toEqual({ pong: 'it works!' });
});

// Add more tests as needed
});

describe('Fastify API tests', () => {
let server: fastify.FastifyInstance<Server, IncomingMessage, ServerResponse>;

Expand Down

0 comments on commit 07d838c

Please sign in to comment.