-
Notifications
You must be signed in to change notification settings - Fork 21
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
Meteor 1.3 and testing packages #16
Comments
Ideally I could import the Factory in 1.3, using it as a module. |
Hey @flippyhead it looks like you may need to specify the version of the package as it looks as though it's pulled in the very first release. I'll update the package for 1.3 soon. |
Hi @dburles, this seems to be happening again in 1.4, in the changelog I see MDG changed something about how packages are imported. Maybe it'll only work now with the I tried the following:
Which is very weird, because Factories doesn't appear in the source code available online nor is it exported from Update: I forked the package and updated the first couple of lines to look like this:
and changed |
Hey @flippyhead I'm pretty sure it should still work, you don't have to |
@dburles I also tried without using any |
It definitely works, I just double checked on a fresh 1.4 project and everything works fine. I'd recommend trying the same thing, it may help you to debug your existing project. |
I try to use Factory with Meteor Package test.
than I try
but I has got an error 'Factory.define is not a function'. Than I try run this part of code in the Meteor test (Not package test) and it works fine. @dburles Can you help me import this package to Meteor package test? |
@pj-infest this is the same issue I had / still have. I rewrote the file as described above (took about 30 seconds) and it works fine. @dburles didn't seem to get this error, so I dunno what the issue is, just how to fix it ;) |
I didn't mention in my report explicitly that it's with testing packages (it is) but it says so in both the issue title and the OP so I'm assuming @dburles is aware.. |
Possible to put up a simple reproduction app I can look at? I'm not sure I fully understand where things are going wrong |
@dburles Reproduce error recept:
First test is successful, but second test from testing package file is failed. When I run test on client and on server it fails with message When I run test only on server it fails with When I run this code in global Project test it is no errors (but they appear in package tests) Please help me resolve this problem. |
Hey @pj-infest the problem you're having is the same as what @flippyhead originally posted. Meteor is pulling in the earliest compatible version of this package, which had a different API. You need to specify the version of the package that you're after, the latest version is 1.1.0. Change Which will likely result in:
Also you don't need to explicitly import Factory. It will be global. |
I seem to be missing something. When following the README but using Factory in a package I get errors like this:
Thank you!
The text was updated successfully, but these errors were encountered: