Skip to content

Commit

Permalink
Add a test to ensure just one warning
Browse files Browse the repository at this point in the history
A test to make sure the warning is emitted just once might provide proper coverage.
  • Loading branch information
danieljbruce committed Oct 23, 2023
1 parent 997a7f6 commit a193f29
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,17 @@ describe('Query', () => {
process.on('warning', onWarning);
new Query(['kind1']).filter('name', 'Stephen');
});
it('should not issue a warning again when a Filter instance is not provided', done => {
const onWarning = () => {
assert.fail();
};
process.on('warning', onWarning);
new Query(['kind1']).filter('name', 'Stephen');
setImmediate(() => {
process.removeListener('warning', onWarning);
done();
});
});
it('should support filtering', () => {
const now = new Date();
const query = new Query(['kind1']).filter('date', '<=', now);
Expand Down

0 comments on commit a193f29

Please sign in to comment.