Skip to content

Commit

Permalink
276th Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Shyam-Chen committed Feb 29, 2024
1 parent 467d8bd commit 8f20d9c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/routes/todos/__tests__/+handler.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import mongodb from '@fastify/mongodb';
import fastify from 'fastify';
import { MongoMemoryServer } from 'mongodb-memory-server';
import fastify from 'fastify';
import mongodb from '@fastify/mongodb';

import todos from '../+handler';

Expand Down Expand Up @@ -45,4 +45,8 @@ test('POST /todos', async () => {
const res4 = await app.inject({ method: 'POST', url: '/todos', payload: { title: 'Vue' } });
expect(res4.json().result.length).toBe(0);
expect(res4.json().total).toBe(0);

const res5 = await app.inject({ method: 'POST', url: '/todos', payload: { filter: 1 } });
expect(res5.json().result.length).toBe(10);
expect(res5.json().total).toBe(15);
});

0 comments on commit 8f20d9c

Please sign in to comment.