@kayahr/assert
    Preparing search index...

    Function assertAll

    Asserts that all given functions do not throw exceptions. The difference to running multiple single asserts is that execution doesn't stop at the first exception. All functions are executed, exceptions are gathered and when multiple of these functions throw exceptions then assertAll throws an AssertionError with an array of all these exceptions as root cause.

    Examples:

    assertAll([
    () => assertNotNull(value),
    () => assertGreaterThan(value, 20),
    () => assertLessThan(value, 40),
    ])

    await assertAll([
    () => assertNotNull(value),
    async () => assertNotNull(await getAsyncValue())
    ])

    The functions to execute. May be synchronous or asynchronous. If at least one function is asynchronous then the assertAll function is also asynchronous and returns a promise.

    AssertionError when a nested assertion fails or when multiple functions throw exceptions. If only one function throws an exception which is not an AssertionError then this root exception is passed through unchanged.

    • Parameters

      • ...funcs: (() => undefined | void)[]

      Returns void

    • Parameters

      • ...funcs: (() => undefined | void | Promise<undefined | void>)[]

      Returns Promise<void>