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

TypeError: Cannot read property 'resolveRegistration' of undefined #230

Closed
Turbo87 opened this issue Oct 20, 2017 · 5 comments
Closed

TypeError: Cannot read property 'resolveRegistration' of undefined #230

Turbo87 opened this issue Oct 20, 2017 · 5 comments

Comments

@Turbo87
Copy link
Member

Turbo87 commented Oct 20, 2017

With the new testing APIs I'm hitting this error for a lot of our tests:

TypeError: Cannot read property 'resolveRegistration' of undefined
     at exports.default (http://localhost:3201/assets/vendor.js:115071:34)
     at exports.default (http://localhost:3201/assets/vendor.js:115145:32)
     at Object.<anonymous> (http://localhost:3201/assets/tests.js:56620:44)
     at callHook (http://localhost:3201/assets/test-support.js:3910:25)
     at runHook (http://localhost:3201/assets/test-support.js:3933:7)
     at Object.advance (http://localhost:3201/assets/test-support.js:3536:26)
     at begin (http://localhost:3201/assets/test-support.js:5348:20)
     at http://localhost:3201/assets/test-support.js:5308:6

which seems to be caused by https://github.com/danielspaniel/ember-data-factory-guy/blob/958a51632e1252e9af949148759f91c13ab77293/addon/utils/load-scenarios.js#L16

/cc @danielspaniel

@rwjblue
Copy link
Member

rwjblue commented Oct 20, 2017

@Turbo87 - What ember version? What type of test (setupTest or setupRenderingTest)? What are you passing in to loadScenarios?

@Turbo87
Copy link
Member Author

Turbo87 commented Oct 20, 2017

What ember version?

Ember 2.12

What type of test (setupTest or setupRenderingTest)?

setupTest() in this case

What are you passing in to loadScenarios?

We have been calling manualSetup(this.container) so far, which essentially does this.container.owner.resolveRegistration(...). I'm now passing this.owner instead, but this.owner.owner does not exist so the call above fails.

I've submitted adopted-ember-addons/ember-data-factory-guy#308 to make the addon compatible with our efforts here.

I guess this is not actually a bug in the new API implementation, just an addon that is not yet compatible.

@rwjblue
Copy link
Member

rwjblue commented Oct 20, 2017

Ahh, gotcha. Thanks for tracking it down!

@danielspaniel
Copy link

https://github.com/danielspaniel/ember-data-factory-guy/releases/tag/v2.13.8 has the fix for this issue in factory-guy

@Turbo87
Copy link
Member Author

Turbo87 commented Oct 20, 2017

@danielspaniel thanks!

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

3 participants