Skip to content

Commit

Permalink
Revoked RegExp fix
Browse files Browse the repository at this point in the history
  • Loading branch information
valerybugakov committed Jul 11, 2016
1 parent b19ea78 commit 4ee552a
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions packages/jest-matchers/src/matchers.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,7 @@ const matchers: MatchersObject = {
},

toMatch(actual: any, expected: string) {
if (
!(typeof expected === 'string') &&
!(Object.prototype.toString.call(expected) === '[object RegExp]')
) {
if (!(expected instanceof RegExp) && !(typeof expected == 'string')) {
return {
pass: false,
message: `expected '${expected}' is not a String or a RegExp`,
Expand Down

0 comments on commit 4ee552a

Please sign in to comment.