Skip to content

Commit

Permalink
Fix test to use logger.info() method
Browse files Browse the repository at this point in the history
  • Loading branch information
dgaubert committed May 12, 2020
1 parent 7d64a60 commit 8cd36df
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ describe('RedisPool', function () {
await redisPool.release(0, client2);
});

it('log is called if elapsed time is above configured one', async function () {
it('logger is called if elapsed time is above configured one', async function () {
let logWasCalled = false;
const elapsedThreshold = 25;
const enabledSlowPoolConfig = {
Expand All @@ -160,10 +160,10 @@ describe('RedisPool', function () {
};

const consoleLogFunc = console.error;
console.error = function (what) {
const whatObj = JSON.parse(what);
logWasCalled = whatObj && whatObj.action && whatObj.action === 'acquire';
consoleLogFunc.apply(console, arguments);
console.info = function (what) {
logWasCalled = what && what.action && what.action === 'acquire';
// uncomment the following line for debugging
// consoleLogFunc.apply(console, arguments);
};

// test
Expand Down

0 comments on commit 8cd36df

Please sign in to comment.