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

Adds helpful failure messages when a test operation fails. #71

Merged
merged 2 commits into from
Aug 28, 2018

Conversation

devpaul
Copy link
Member

@devpaul devpaul commented Aug 20, 2018

Resolves #44

@devpaul
Copy link
Member Author

devpaul commented Aug 20, 2018

Sample error message

Test operation failure at "test". Expected boolean "true" but got string "true" instead.

Errors are a notification + cause; i.e. "Test operation failure at ${ location }. ${ cause }". (see https://github.com/dojo/framework/pull/71/files#diff-a6b7da537e090f6599b6cde4522e420dR59).

Sample list of causes here: https://github.com/dojo/framework/pull/71/files#diff-8d68c3bca00aa78c6f8ad7d262a0442bR71

@@ -51,6 +52,15 @@ function add(pointerTarget: PointerTarget, value: any): any {
return pointerTarget.object;
}

function assert(pointerTarget: PointerTarget, value: any) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we keep this as test inline with the operation type?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved it to match the other sections and because the test seemed like a separate responsibility from transversing the paths. Since I moved the comparison stuff for the difference message into its own function there's not a lot of complexity so I guess it's ok to move it back.

@agubler
Copy link
Member

agubler commented Aug 21, 2018

Do you think we can report the whole path to the failed test? I think at the moment you are just reporting the segment.

@devpaul
Copy link
Member Author

devpaul commented Aug 27, 2018

resolved comments and added tests to match changes. 👍

@devpaul devpaul merged commit 5bff9f5 into dojo:master Aug 28, 2018
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.

2 participants