Last active
March 7, 2017 16:44
-
-
Save eschwartz/c6e4390982f1bc4744e46408279e80ce to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function assertMatch(actual:string, regex: string | RegExp, msg?:string):void { | |
const regexNorml:RegExp = _.isString(regex) ? new RegExp(regex as string) : regex; | |
const isMatch = regexNorml.test(actual); | |
if (!isMatch) { | |
assert.fail(actual, regexNorml.toString(), msg, 'matches'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment