Assert that a Result is a failure and return the error
const result = await useCase.execute(invalidCommand);const error = unwrapFailure(result);expect(error.message).toBe('Invalid command'); Copy
const result = await useCase.execute(invalidCommand);const error = unwrapFailure(result);expect(error.message).toBe('Invalid command');
Assert that a Result is a failure and return the error