-
Notifications
You must be signed in to change notification settings - Fork 9
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
TESTING: Revisit testing of computed property dependent keys #60
Comments
Regarding your suggested alternative, no emphasis has been removed from testing units of functionality. In order to test such things, one could reasonably make a call to a method, say |
Some counterpoints:
|
I feel that the recommended method of testing dependent keys for computed properties is problematic for several reasons:
_dependentKeys
property is problematic since there is no guarantee it will exist in future Ember versions and in which case all of these tests would need to be rewritten.As an alternative, I feel that the emphasis should be on testing units of functionality rather than directly testing that specific properties are set. For example, if the desired functionality of a component is that a triggered action changes the value of a property on the component, the test should trigger the action then test that the value is what is expected. This way the component could be refactored and the tests still pass. If, on the other hand, the tests are too specific, they would all fail after a refactor and need to be rewritten. Then we have to ask ourselves why we are even writing tests in the first place.
The text was updated successfully, but these errors were encountered: