-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.test.js
46 lines (45 loc) · 1.46 KB
/
server.test.js
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
const request = require('supertest');
const app = require('./server.js');
describe('Test the root path', () => {
test('It should response the GET method', (done) => {
request(app).get('/').then((response) => {
expect(response.statusCode).toBe(200);
done();
});
});
});
describe('Information should have a defined body ', () => {
test('Information should return a response body ', () => {
return request(app).get('/information/101').then((response) => {
expect(response).toBeDefined();
});
});
});
describe('Pictures should have a defined body ', () => {
test('Pictures should return a response body ', () => {
return request(app).get('/pictures/105').then((response) => {
expect(response).toBeDefined();
});
});
});
describe('Title should have a defined body ', () => {
test('Pictures should return a response body ', () => {
return request(app).get('/title/107').then((response) => {
expect(response).toBeDefined();
});
});
});
describe('Map should have a defined body ', () => {
test('Pictures should return a response body ', () => {
return request(app).get('/map/140').then((response) => {
expect(response.body).toBeDefined();
});
});
});
describe('Restaurants should have a defined body ', () => {
test('Pictures should return a response body ', () => {
return request(app).get('/restaurants/140/reviews').then((response) => {
expect(response.body).toBeDefined();
});
});
});