Skip to content

Commit

Permalink
Add shouldClearNativeTimers to integration tests
Browse files Browse the repository at this point in the history
As some of the test libraries are actually creating real timers
  • Loading branch information
voxpelli committed Jun 7, 2023
1 parent 12fdabd commit 0d63e28
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions test/integration/express.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ describe('Express', () => {

describe('touching', () => {
it('should update expiry dates on existing sessions when rolling is set', async () => {
const clock = sinon.useFakeTimers({ now: 1483228800000 });
const clock = sinon.useFakeTimers({ now: 1483228800000, shouldClearNativeTimers: true });

store = new (connectPgSimple(session))({ conObject });

Expand All @@ -157,7 +157,7 @@ describe('Express', () => {
});

it('should not update expiry dates on existing sessions when disableTouch is set', async () => {
const clock = sinon.useFakeTimers({ now: 1483228800000 });
const clock = sinon.useFakeTimers({ now: 1483228800000, shouldClearNativeTimers: true });

store = new (connectPgSimple(session))({ conObject, disableTouch: true });

Expand Down Expand Up @@ -190,7 +190,7 @@ describe('Express', () => {
const app = appSetup(store);
const agent = request.agent(app);

const clock = sinon.useFakeTimers(Date.now());
const clock = sinon.useFakeTimers({ now: Date.now(), shouldClearNativeTimers: true });

return queryPromise('SELECT COUNT(sid) FROM session')
.should.eventually.have.nested.property('rows[0].count', '0')
Expand Down
2 changes: 1 addition & 1 deletion test/integration/pgpromise.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ describe('pgPromise', () => {
const app = appSetup(store);
const agent = request.agent(app);

const clock = sinon.useFakeTimers(Date.now());
const clock = sinon.useFakeTimers({ now: Date.now(), shouldClearNativeTimers: true });

return queryPromise('SELECT COUNT(sid) FROM session')
.should.eventually.have.nested.property('rows[0].count', '0')
Expand Down

0 comments on commit 0d63e28

Please sign in to comment.