-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.test.js
More file actions
29 lines (27 loc) · 1.04 KB
/
app.test.js
File metadata and controls
29 lines (27 loc) · 1.04 KB
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
const app = require("./app");
const request = require("supertest");
describe("POST /test", () => {
describe("When username an password are passed", () => {
test("should be redirected and respond with status 302", async () => {
const response = await request(app).post("/register").send({
username: "username",
password: "password"
})
expect(response.status).toBe(302)
})
})
})
describe("GET /test", () => {
describe("when the home page is reached", () => {
test("Should respond with status code 200", async () => {
const response = await request(app).get("/")
expect(response.status).toBe(200)
})
})
// describe("Is the database connected successfully to the node js app", () => {
// test("the api endpoint /results should respond with status code 200", async () => {
// const response = await request(app).get("/results")
// expect(response.status).toBe(302)
// })
// })
})