Web API for code.
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

index.test.tsx 562 B

12345678910111213141516171819202122
  1. import { describe, it, expect, beforeAll } from 'vitest';
  2. import {FastifyInstance} from 'fastify';
  3. import { createServer } from '../src/server';
  4. import { addRoutes } from '../src/routes';
  5. describe('Example', () => {
  6. let server: FastifyInstance
  7. beforeAll(() => {
  8. server = createServer()
  9. addRoutes(server)
  10. })
  11. it('should have the expected content', async () => {
  12. const response = await server
  13. .inject()
  14. .get('/')
  15. .headers({
  16. 'Accept': 'application/json',
  17. });
  18. expect(response.statusCode).toBe(200);
  19. });
  20. });