MCPcopy Index your code
hub / github.com/NativeScript/NativeScript / assertThrows

Function assertThrows

apps/automated/src/tk-unit.ts:323–326  ·  view source on GitHub ↗
(testFunc: () => void, assertMessage?: string, expectedMessage?: string)

Source from the content-addressed store, hash-verified

321}
322
323export function assertThrows(testFunc: () => void, assertMessage?: string, expectedMessage?: string) {
324 const re = expectedMessage ? new RegExp(`^${expectedMessage}$`) : null;
325 return assertThrowsRegExp(testFunc, assertMessage, re);
326}
327
328export function assertThrowsRegExp(testFunc: () => void, assertMessage?: string, expectedMessage?: RegExp) {
329 let actualError: Error;

Calls 1

assertThrowsRegExpFunction · 0.85

Tested by

no test coverage detected