Skip to content

Commit

Permalink
Fix tests to expect numeric strings
Browse files Browse the repository at this point in the history
  • Loading branch information
voxpelli committed Nov 12, 2022
1 parent 43c015d commit ad658ee
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/integration/express.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,15 +143,15 @@ describe('Express', () => {

const firstResult = await queryPromise('SELECT extract(epoch from expire) AS expire FROM session');
firstResult.should.have.property('rows').that.has.length(1)
.with.nested.property('[0].expire').that.is.a('number');
.with.nested.property('[0].expire').that.matches(/\d+/);

await clock.tickAsync(10000);

await agent.get('/').expect(200);

const secondResult = await queryPromise('SELECT extract(epoch from expire) AS expire FROM session');
secondResult.should.have.property('rows').that.has.length(1)
.with.nested.property('[0].expire').that.is.a('number');
.with.nested.property('[0].expire').that.matches(/\d+/);

(secondResult.rows[0].expire - firstResult.rows[0].expire).should.equal(10);
});
Expand All @@ -170,15 +170,15 @@ describe('Express', () => {

const firstResult = await queryPromise('SELECT extract(epoch from expire) AS expire FROM session');
firstResult.should.have.property('rows').that.has.length(1)
.with.nested.property('[0].expire').that.is.a('number');
.with.nested.property('[0].expire').that.matches(/\d+/);

await clock.tickAsync(10000);

await agent.get('/').expect(200);

const secondResult = await queryPromise('SELECT extract(epoch from expire) AS expire FROM session');
secondResult.should.have.property('rows').that.has.length(1)
.with.nested.property('[0].expire').that.is.a('number');
.with.nested.property('[0].expire').that.matches(/\d+/);

(secondResult.rows[0].expire - firstResult.rows[0].expire).should.equal(0);
});
Expand Down

0 comments on commit ad658ee

Please sign in to comment.