Skip to content

Commit

Permalink
test: add test coverage to the set up middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
Mateu Aguiló Bosch committed May 28, 2018
1 parent a1904c7 commit e4246da
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/middlewares/copyToRequestObject.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// @flow

const copyToRequestObject = require('./copyToRequestObject');

describe('The set up process', () => {
test('It can copy variables', () => {
expect.assertions(2);
const req = {};
const next = jest.fn();
copyToRequestObject({ foo: 'bar' })(req, null, next);
expect(req.foo).toBe('bar');
expect(next).toHaveBeenCalled();
});
});
1 change: 1 addition & 0 deletions src/routes/healthcheck.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const healthcheck = require('./healthcheck');

describe('The healthcheck route', () => {
test('It responds', () => {
expect.assertions(2);
const res = {
set: jest.fn(),
json: jest.fn(),
Expand Down

0 comments on commit e4246da

Please sign in to comment.