When the pattern is a regular expression and the object has not
already been detected as a regular expression too, one can be almost
100 % certain that the user meant to compare the stringified version
of the left-hand side (e.g. for errors, arrays, etc.) against
the regular expression.
Previously, this would almost always pass silently in these simple
cases.
This is likely a semver-major change, both for tmatch and tap.
(side note: I was particularly confused when looking into this by the fact that node-tap.org itself says that tap uses t.match(er, …) for t.throws. I’d PR over there too, but I can’t seem to find the website repo, if there is any.)
When the pattern is a regular expression and the object has not already been detected as a regular expression too, one can be almost 100 % certain that the user meant to compare the stringified version of the left-hand side (e.g. for errors, arrays, etc.) against the regular expression.
Previously, this would almost always pass silently in these simple cases.
This is likely a semver-major change, both for
tmatch
andtap
.(side note: I was particularly confused when looking into this by the fact that node-tap.org itself says that
tap
usest.match(er, …)
fort.throws
. I’d PR over there too, but I can’t seem to find the website repo, if there is any.)/cc @isaacs