emberjs / ember.js

Ember.js - A JavaScript framework for creating ambitious web applications
https://emberjs.com
MIT License
22.47k stars 4.21k forks source link

this.set('myprop', value) vs this.myprop = value in test blueprints #18540

Closed gabrielgrant closed 5 years ago

gabrielgrant commented 5 years ago

The default component test blueprint (and a few others, iirc) currently recommends using this.set, rather than setting props directly: https://github.com/emberjs/ember.js/blob/master/blueprints/component-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.js#L10-L11

Is using this.set() actually required, or could this recommendation be changed to just directly set the prop on this using standard JS syntax? AFAICT, this.myprop = myvalue seems to work fine for both props and actions in a component integration test, but I may be missing something subtle here?

Happy to throw together a PR to clean this up if it's wanted/would be useful

gabrielgrant commented 5 years ago

uhh...yea, was definitely missing something: this works for initial set, but not changing a value facepalm