UNPKG

@ethereum-waffle/chai

Version:

A sweet set of chai matchers for your blockchain testing needs.

11 lines (9 loc) 279 B
interface ErrorConstructor<T extends any[]> { new (...args: T): Error; } export function ensure<T extends any[]>(condition: boolean, ErrorToThrow: ErrorConstructor<T>, ...errorArgs: T): asserts condition { if (!condition) { throw new ErrorToThrow(...errorArgs); } }