Web API for code.
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 

23 řádky
562 B

  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. });