Last active
December 18, 2019 17:24
-
-
Save hellotunmbi/d18ffe986a46992552b1ed0b83b511dd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//movies.spec.js | |
const supertest = require('supertest'); | |
const app = require('../server'); | |
describe("Testing the movies API", () => { | |
it("tests the base route and returns true for status", async () => { | |
const response = await supertest(app).get('/'); | |
expect(response.status).toBe(200); | |
expect(response.body.status).toBe(true); | |
}); | |
it("tests the get movies endpoint and have message property", async () => { | |
const response = await supertest(app).get('/movies'); | |
expect(response.status).toBe(200); | |
expect(response.body.status).toBe('success'); | |
expect(response.body).toHaveProperty('message'); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment