Please sign in to comment.
assert: implement `assert.match()` and `assert.doesNotMatch()`
This adds a new functionality to the assertion module: a dedicated check for regular expressions. So far it's possible to use `assert.ok(regexp.test(string))`. This is not ideal though when it comes to the error message, since it's not possible to know how either of the input values look like. It's just known that the assertion failed. This allows to pass through the regular expression and the input string. The string is then matched against the regular expression and reports a expressive error message in case of a failure. PR-URL: #30929 Reviewed-By: Michaël Zasso <email@example.com> Reviewed-By: Rich Trott <firstname.lastname@example.org> Reviewed-By: Stephen Belanger <email@example.com>
- Loading branch information
Showing with 220 additions and 4 deletions.