You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: I think this is low priority since there is a workaround (scroll to the bottom), but I still wanted to open it in case someone runs into the same issue.
Easy repro steps:
$ ember new ember new router-main-injection-not-found && \
cd router-main-injection-not-found && \
bower install ember#1.11.4 && \
ember g route dummy-route && \
ember test
Note: the same error occurs for 1.11, 1.12, route and controller unit tests.
Expected
The tests should pass.
Actual the test fails with the message Attempting to inject an unknown injection:router:main`. Full log:
not ok 10 PhantomJS 2.1 - Unit | Route | dummy route: it exists
---
actual: >
null
stack: >
validateInjections@http://localhost:7357/assets/vendor.js:11622:91
buildInjections@http://localhost:7357/assets/vendor.js:10772:45
injectionsFor@http://localhost:7357/assets/vendor.js:10827:37
factoryFor@http://localhost:7357/assets/vendor.js:10804:37
lookupFactory@http://localhost:7357/assets/vendor.js:10679:24
factory@http://localhost:7357/assets/test-support.js:7342:39
http://localhost:7357/assets/test-support.js:7422:75
http://localhost:7357/assets/tests.js:153:29
wrapper@http://localhost:7357/assets/test-support.js:6322:34
runTest@http://localhost:7357/assets/test-support.js:2502:32
run@http://localhost:7357/assets/test-support.js:2487:11
http://localhost:7357/assets/test-support.js:2629:14
process@http://localhost:7357/assets/test-support.js:2288:24
begin@http://localhost:7357/assets/test-support.js:2270:9
http://localhost:7357/assets/test-support.js:2330:9
message: >
Died on test #1 testWrapper@http://localhost:7357/assets/test-support.js:6351:16
test@http://localhost:7357/assets/test-support.js:6364:44
http://localhost:7357/assets/tests.js:152:24
exports@http://localhost:7357/assets/vendor.js:92:39
build@http://localhost:7357/assets/vendor.js:142:17
findModule@http://localhost:7357/assets/vendor.js:190:14
requireModule@http://localhost:7357/assets/vendor.js:177:22
require@http://localhost:7357/assets/test-loader.js:67:16
loadModules@http://localhost:7357/assets/test-loader.js:58:25
load@http://localhost:7357/assets/test-loader.js:89:35
http://localhost:7357/assets/test-support.js:6183:20: Attempting to inject an unknown injection: `router:main`
Log: |
...
Based on the description from PR#100 "This ensures they receive no router at all instead of the 1.13-safe one.", I think it's better for those versions to receive a full router instead of no router at all.
Workaround: simply add needs: ['router:main'] to all your route and controller tests or upgrade to 1.13.
The text was updated successfully, but these errors were encountered:
Versions of Ember prior to 1.13 require a full router booted by the app,
or no router at all. This ensures they receive no router at all instead
of the 1.13-safe one.
Sorry that this has caused you trouble, but I am going to go ahead and close the issue. The work around seems good enough for now, and Ember < 1.13 is getting very long in the tooth at this point...
Note: I think this is low priority since there is a workaround (scroll to the bottom), but I still wanted to open it in case someone runs into the same issue.
Easy repro steps:
Note: the same error occurs for 1.11, 1.12, route and controller unit tests.
Expected
The tests should pass.
Actual the test fails with the message
Attempting to inject an unknown injection:
router:main`. Full log:Prior to #100 these tests worked fine. https://github.com/zenefits/ember-test-helpers/commit/eb3e171f0c4218bd83e34328c307a8f73e8bb1d9 fixes the issue.
{{link-to}}
is broken with and without the commit in 1.11 and 1.12.Based on the description from PR#100 "This ensures they receive no router at all instead of the 1.13-safe one.", I think it's better for those versions to receive a full router instead of no router at all.
Workaround: simply add
needs: ['router:main']
to all your route and controller tests or upgrade to 1.13.The text was updated successfully, but these errors were encountered: