• Assert that a Result is a failure and return the error

    Type Parameters

    • T

    Parameters

    • result: Result<T>

    Returns Error

    const result = await useCase.execute(invalidCommand);
    const error = unwrapFailure(result);
    expect(error.message).toBe('Invalid command');