Web API for code.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

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