generated from MultiverseLearningProducts/express-get-musicians
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.test.js
46 lines (31 loc) · 1.21 KB
/
index.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
// install dependencies
const { execSync } = require('child_process');
execSync('npm install');
execSync('npm run seed');
const request = require("supertest")
const { db } = require('./db/connection');
const { Musician, Band } = require('./models/index')
const app = require('./src/app');
const {seedMusician} = require("./seedData");
describe('./musicians endpoint', () => {
// Write your tests here
test('can get all musicians from server', async () => {
const response = await request(app).get("/musicians");
expect(response.statusCode).toBe(200);
})
test('can get single musician from server', async () => {
const response = await request(app).get("/musicians/1");
expect(response.statusCode).toBe(200);
})
})
describe('./bands endpoint', () => {
// Write your tests here
test('can get all bands from server', async () => {
const response = await request(app).get("/bands");
expect(response.statusCode).toBe(200);
})
// test('can get single musician from server', async () => {
// const response = await request(app).get("/musicians/1");
// expect(response.statusCode).toBe(200);
// })
})