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

can't test custom factories #169

Closed
olivierlesnicki opened this issue May 15, 2015 · 3 comments
Closed

can't test custom factories #169

olivierlesnicki opened this issue May 15, 2015 · 3 comments

Comments

@olivierlesnicki
Copy link

In my app I've crated a folder called requests and it contains one file called login.

In my app I'm able to use: container.lookup('request:login') and it resolved correctly.
In my unit test however, using moduleFor('request:login') throws an error message:

TypeError: Attempting to register an unknown factory:

Is moduleFor only reserved for ember base objects?

@rwjblue
Copy link
Member

rwjblue commented May 15, 2015

No, I would expect it to work (seems to in a simple JSBin). Can you share the moduleFor and test code?

@olivierlesnicki
Copy link
Author

@rwjblue, I've replicated your example within ember-cli and it works just fine (as you mentioned). There's probably something specific to my project that is causing it to fail. Closing the issue in the mean time.

Thanks

@olivierlesnicki
Copy link
Author

@rwjblue got to the bottom of the issue:

  • I created an addon
  • I created addon/requests/foo
  • I created tests/unit/requests/foo-test

This was throwing the error mentioned above when running ember test. I then added app/requests/foo as a link to the addon/request/foo file and it started working.

It might be the expected behavior.

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

2 participants