forked from amandapeggie/LBG4-API
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.test.js
More file actions
32 lines (22 loc) · 665 Bytes
/
app.test.js
File metadata and controls
32 lines (22 loc) · 665 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
const request = require('supertest');
const app = require('./app').app;
const build = require('./app').itemBuilder;
// unit testing the item builder
describe('Unit Tests', () => {
test('item object builder', () => {
expect(build('', '', '', ''))
.toMatchObject(
{}
);
});
});
describe('GET requests', () => {
test('GET /read endpoint, expect 200', async () => {
const res = await request(app).get('/read')
expect(res.statusCode).toBe(200);
});
// time to create a bad endpoint test (404)
});
describe('CREATE request', () => {
// we could also test the create request
});