(actual: Array<any>, expected: Array<any>, message?: string)
| 309 | } |
| 310 | |
| 311 | export function arrayAssert(actual: Array<any>, expected: Array<any>, message?: string) { |
| 312 | if (actual.length !== expected.length) { |
| 313 | throw new Error(message + ' Actual array length: ' + actual.length + ' Expected array length: ' + expected.length); |
| 314 | } |
| 315 | |
| 316 | for (let i = 0; i < actual.length; i++) { |
| 317 | if (actual[i] !== expected[i]) { |
| 318 | throw new Error(message + ' Actual element at ' + i + ' is: ' + actual[i] + ' Expected element is: ' + expected[i]); |
| 319 | } |
| 320 | } |
| 321 | } |
| 322 | |
| 323 | export function assertThrows(testFunc: () => void, assertMessage?: string, expectedMessage?: string) { |
| 324 | const re = expectedMessage ? new RegExp(`^${expectedMessage}$`) : null; |
nothing calls this directly
no outgoing calls
no test coverage detected