Skip to content

Commit

Permalink
Test genres end point
Browse files Browse the repository at this point in the history
  • Loading branch information
MuhannedNoman committed Sep 1, 2020
1 parent 876338c commit ef13ef3
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const express = require('express');
const app = express();
const winston = require('winston');
const app = express();

require('./startup/logging')();
require('./startup/config')();
Expand Down
3 changes: 3 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
testEnvironment: 'node',
};
18 changes: 18 additions & 0 deletions tests/integration/genres.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const request = require('supertest');
let server;

describe('/api/genres', () => {
beforeEach(() => {
server = require('../../index');
});

afterEach(() => {
server.close();
});
describe('GET /', () => {
it('should return all genres', async () => {
const res = await request(server).get('/api/genres');
expect(res.status).toBe(200);
});
});
});

0 comments on commit ef13ef3

Please sign in to comment.