( actual: string, expected: RegExp, msg?: string, )
| 19 | * @param msg The optional message to display if the assertion fails. |
| 20 | */ |
| 21 | export function assertMatch( |
| 22 | actual: string, |
| 23 | expected: RegExp, |
| 24 | msg?: string, |
| 25 | ) { |
| 26 | if (expected.test(actual)) return; |
| 27 | const msgSuffix = msg ? `: ${msg}` : "."; |
| 28 | msg = `Expected actual: "${actual}" to match: "${expected}"${msgSuffix}`; |
| 29 | throw new AssertionError(msg); |
| 30 | } |
no outgoing calls
no test coverage detected