Skip to content
This repository has been archived by the owner on Nov 4, 2020. It is now read-only.

Commit

Permalink
Fix .match(RegExp) for everything not supported
Browse files Browse the repository at this point in the history
  • Loading branch information
btd committed Mar 9, 2017
1 parent 64ad890 commit 52b984f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions lib/ext/match.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ export default function(should, Assertion) {

this.assert(notMatchedProps.length === 0);
} // should we try to convert to String and exec?
else {
this.assert(false);
}
} else if (typeof other == 'function') {
var res;

Expand Down
4 changes: 3 additions & 1 deletion test/ext/match.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var err = require('../util').err;
require('../../');
var should = require('../../');

describe('match', function() {

Expand Down Expand Up @@ -29,6 +29,8 @@ describe('match', function() {

({ a: 'a' }).should.not.match(/^http/);

should(null).not.match(/bar/);

// positive false
err(function() {
({ a: 'foo', c: 'barfoo' }).should.not.match(/foo$/);
Expand Down

0 comments on commit 52b984f

Please sign in to comment.