mirror of
https://github.com/usatiuk/ustk-todolist.git
synced 2025-10-28 23:57:49 +01:00
refactoring, fix todo removal from lists
This commit is contained in:
22
tests/integration/lists.test.js
Normal file
22
tests/integration/lists.test.js
Normal file
@@ -0,0 +1,22 @@
|
||||
const server = require('../../app.js');
|
||||
|
||||
const request = require('supertest');
|
||||
const mongoose = require('mongoose');
|
||||
|
||||
afterAll(async () => {
|
||||
await mongoose.connection.dropDatabase();
|
||||
await mongoose.disconnect();
|
||||
await server.close();
|
||||
});
|
||||
|
||||
describe('test lists', () => {
|
||||
test('index lists', async () => {
|
||||
const response = await request(server)
|
||||
.get('/lists')
|
||||
.set('Accept', 'application/json')
|
||||
.expect(200)
|
||||
.expect('Content-Type', 'application/json; charset=utf-8');
|
||||
expect(response.body.success).toBe(true);
|
||||
expect(response.body.data).toBeInstanceOf(Array);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user