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

Better assertion message when ember asserts. #247

Closed
kiwiupover opened this issue Nov 1, 2016 · 8 comments
Closed

Better assertion message when ember asserts. #247

kiwiupover opened this issue Nov 1, 2016 · 8 comments

Comments

@kiwiupover
Copy link

The object that the error is thrown on is returned as [object Object].

Assertion Failed: You modified image1xFile twice on [object Object] in a single render.

I believe ember overwrites the toString for ember created objects like components to return the name of the object but the ember-quint is not overwriting the toString method for objects it creates.

@rwjblue maybe you can give more context here.

@rwjblue
Copy link
Member

rwjblue commented Nov 1, 2016

👍 discovered this while pairing with @kiwiupover

@trentmwillis - I'd love your thoughts here...

@rwjblue
Copy link
Member

rwjblue commented Nov 1, 2016

I am happy to add a toString to the context when it is set in ember-qunit and/or ember-test-helpers, but it seems like it may be a generally useful thing upstream in QUnit?

@trentmwillis
Copy link
Member

I think I'm missing something, it sounds like the suggestion is to add toString to the test environment, which seems odd to me, as you shouldn't be passing the test environment into your application code.

@kiwiupover
Copy link
Author

kiwiupover commented Nov 1, 2016

In an integration test where a component is instantiated the test is the outside context. Ember when makes an assertion at that point the test is the object that ember is using in the assertion object hench test.toString() returns [object Object] not a helpful error.

@trentmwillis
Copy link
Member

Okay, thanks that makes more sense. I think this is something that should be handled in ember-test-helpers, as it seems like it could also apply to ember-mocha and, as it stands, it seems primarily related to an Ember-specific debuggability issue. Though if there are other common use cases, feel free to open an issue upstream with QUnit.

@rwjblue
Copy link
Member

rwjblue commented Nov 2, 2016

👍 - Sounds good, I'll work up a PR for ember-test-helpers and we can discuss in more detail there...

@kiwiupover
Copy link
Author

kiwiupover commented Nov 2, 2016

@rwjblue would you mind if I write the PR.

@Turbo87
Copy link
Member

Turbo87 commented Oct 14, 2017

seems like this was resolved by emberjs/ember-test-helpers#181

@Turbo87 Turbo87 closed this as completed Oct 14, 2017
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

No branches or pull requests

4 participants