Skip to content
This repository has been archived by the owner on Oct 8, 2024. It is now read-only.

Commit

Permalink
Fixes indentation and spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
pragmaticivan authored and eduardolundgren committed Mar 1, 2017
1 parent 69522bf commit 6f4fd14
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 25 deletions.
3 changes: 0 additions & 3 deletions test/unit/magnet.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,12 @@ describe('Magnet', () => {
it('should start a http server', async () => {
const directory = `${process.cwd()}/test/fixtures/app`;
const magnet = new Magnet({directory});

await magnet.build();
await magnet.start();

await assertAsyncHttpRequest({
path: '/fn',
responseBody: JSON.stringify({foo: 'bar'}),
});

await magnet.stop();
});
});
Expand Down
41 changes: 19 additions & 22 deletions test/unit/middleware/validator-error.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,24 @@ import Magnet from '../../../src/magnet';
describe('validationErrorMiddleware', function() {
it('should manage to catch an exception if an error occurs in a route function with param validator', async () => { // eslint-disable-line max-len
const directory = `${process.cwd()}/test/fixtures/error`;
const magnet = new Magnet({directory});
await magnet.build();
await magnet.start();

const expectedResponseBody = {
'status': 400,
'message': 'Bad Request',
'errors': [
{
'reason': 'parameter_required',
'context': {'param': 'name'},
},
],
};

await assertAsyncHttpRequest({
path: '/error-validation',
status: 400,
responseBody: JSON.stringify(expectedResponseBody),
});

await magnet.stop();
const magnet = new Magnet({directory});
await magnet.build();
await magnet.start();
const expectedResponseBody = {
'status': 400,
'message': 'Bad Request',
'errors': [
{
'reason': 'parameter_required',
'context': {'param': 'name'},
},
],
};
await assertAsyncHttpRequest({
path: '/error-validation',
status: 400,
responseBody: JSON.stringify(expectedResponseBody),
});
await magnet.stop();
});
});

0 comments on commit 6f4fd14

Please sign in to comment.