Skip to content

Instantly share code, notes, and snippets.

@hellotunmbi
Last active December 18, 2019 17:24
Show Gist options
  • Save hellotunmbi/d18ffe986a46992552b1ed0b83b511dd to your computer and use it in GitHub Desktop.
Save hellotunmbi/d18ffe986a46992552b1ed0b83b511dd to your computer and use it in GitHub Desktop.
//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