Open mike-north opened 6 years ago
Totally agree, addon generated tests should always be importing from the addon namespace (not the dummy app). Definitely happy to get PR's for this.
Lots of work in the blueprint space has been happening since this was originally opened, and I'm not sure if all of the examples of "bad cases" are still applicable. I think the first step would be to review the full list of blueprints that ember-source
provides and check what each of them do when used in an addon.
I think the first step would be to review the full list of blueprints that ember-source provides and check what each of them do when used in an addon.
At the very least, the examples enumerated above have not yet been fixed
Currently, mixin-tests generated within an external addon import their respective mixins directly from the
/addon
namespace like this;This is the intended pattern. Several other types of tests (all of which import the thing being tested) import from the dummy app
We should make generated tests consistent and correct in this area by fixing blueprints and blueprint tests.
Known sites where this happens
Util Tests
https://github.com/emberjs/ember.js/blob/04208064f8ecf4d9a31a428090191b37859be08c/node-tests/fixtures/util-test/dummy.js#L1
Initializer Tests
https://github.com/emberjs/ember.js/blob/04208064f8ecf4d9a31a428090191b37859be08c/node-tests/fixtures/instance-initializer-test/dummy.js#L3
Helper Unit Tests
https://github.com/emberjs/ember.js/blob/04208064f8ecf4d9a31a428090191b37859be08c/blueprints/helper-test/qunit-rfc-232-files/tests/__testType__/helpers/__name__-test.js#L17
related: #16841