Skip to content

src/__tests__/books.test.ts โ€‹

From Week 2 in-class: books router ยท original: week2-router/src/__tests__/books.test.ts ยท all files in this project

ts
import { describe, expect, it } from 'vitest';
import request from 'supertest';
import { app } from '../app.js';

describe('GET /books', () => {
  it('starts out empty', async () => {
    const res = await request(app).get('/books');

    expect(res.status).toBe(200);
    expect(res.body).toEqual([]);
  });
});