Skip to content

Commit

Permalink
replace hardcoded error with variable
Browse files Browse the repository at this point in the history
  • Loading branch information
bastienmichaux committed Sep 20, 2017
1 parent eb4ea44 commit f270756
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/test-db-commons.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ describe('lib/db-commons', function () {
let logMock;
let anyDriverName;
let dummySession;
const dummyError = new Error('Dummy error');

beforeEach(function () {
logMock = sandbox.mock(log);
Expand All @@ -37,14 +38,14 @@ describe('lib/db-commons', function () {
logMock.expects('failure').once();
logMock.expects('info').once();

return db.sessionErrorHandler(new Error('dummy Error'));
return db.sessionErrorHandler(dummyError);
});

it('works with a given cause', function () {
logMock.expects('failure').once();
logMock.expects('info').twice();

return db.sessionErrorHandler(new Error('dummy Error'), 'dummy cause');
return db.sessionErrorHandler(dummyError, 'Dummy cause');
});
});

Expand Down

0 comments on commit f270756

Please sign in to comment.