1 2 3 4 5 6 7 8 9 |
x71 x71 x16 x16 x16 x16 |
/** TestingError can be used to test expected error behaviours in tests. */
export class TestingError extends Error {}
/** Throws back an error (can be used where statements are not allowed in syntax). */
export function throws(error: Error | string): never {
if (typeof error === "string")
error = new TestingError(error)
throw error
}
|