Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Result values in failure messages #38

Merged
merged 2 commits into from
Mar 31, 2023

Conversation

Yaevh
Copy link
Contributor

@Yaevh Yaevh commented Mar 20, 2023

When asserting for success and the Result actually fails, the error is not specified in test output, only "Expected Result to be successful but it failed". This complicates the testing process, as for each failing test the user has to analyze the output or re-run the test under the debugger to determine the cause of failure.

In this PR, error and success values are included in test output if an assertion fails. Also the messages themselves are slightly improved to make them more readable.

For example:
Expected Result to be successful but it failed -> Expected myAwesomeResult to succeed, but it failed with error "some error"
Expected Result to be failure but it succeeded -> Expected myAwesomeResult to fail, but it succeeded with value "foo"

@KyleMcMaster
Copy link
Contributor

Thanks for the contribution, I will review the changes and reply with approval or feedback here shortly!

@KyleMcMaster
Copy link
Contributor

I will get a release of these changes out soon! Thanks for the contribution!

@KyleMcMaster KyleMcMaster merged commit dd9cb62 into NitroDevs:main Mar 31, 2023
1 check passed
@Yaevh Yaevh deleted the result-values-in-failure-messages branch March 31, 2023 19:20
@KyleMcMaster
Copy link
Contributor

@Yaevh This is now available in version 2.0.0-prerelease-10-1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants