Skip to content

Commit

Permalink
test: test ignoredMessages with regex including escaped literal
Browse files Browse the repository at this point in the history
  • Loading branch information
waltjones committed Feb 28, 2020
1 parent 80aa38f commit bd2031d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/predicates.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,19 @@ describe('messageIsIgnored', function() {
};
expect(p.messageIsIgnored(logger)(item, settings)).to.not.be.ok();
});
it('false if ignoredMessages regex match', function() {
var item = {
level: 'critical',
body: {
message: {body: '{"data":{"messages":[{"message":"Unauthorized"}]}}'}
}
};
var settings = {
reportLevel: 'debug',
ignoredMessages: ['{"data":{"messages":\\[']
};
expect(p.messageIsIgnored(logger)(item, settings)).to.not.be.ok();
});
it('true if both trace and body message but ignoredMessages only match body', function() {
var item = {
level: 'critical',
Expand Down

0 comments on commit bd2031d

Please sign in to comment.