-
Notifications
You must be signed in to change notification settings - Fork 12
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
Wolfpack works with waterline associations? #11
Comments
Unfortunately I haven't had the time to test or write specs on waterline's new associations. Could you post a sample of your model code and the association? Waterline asynchronously loads collection and keeps a reference to them, so with wolfpack I had to reuse that async logic and create a sync version of it, so you could instantiate a model synchronously. There are still parts of waterline that I haven't tested that could be using this async load features. I'm guessing associations is one, so I'll need to write that part. Again, I'll be really grateful if you could post a sample model with associations so I can test it locally, before launching a release version. Thx |
User model: https://github.com/wejs/we/blob/master/api/models/User.js I think i is possibli to change association to string or array and do the controller test. |
Associations are pretty complex (on the waterline side). As explained before, waterline loads the collections asynchronously. Associations is one reason they do that. Also, since we are now dealing with joins, wolfpack is outdated on its mock result methods. I'm working on a feature that will allow to mock results conditionally, which will solve this issue. However, since that is still in progress, what I'm gonna do for RC2 is to remove support for associations completely. I don't believe that you should change your code to allow wolfpack to execute. Your code is your code, wolfpack is just a testing suite, so wolfpack should handle your code just like waterline would do. What I will do instead is, if I find any associations, im gonna remove them so they don't get initialized and change them to json. This should allow current result mocker to keep working while the new version is in development, so your code will work with the current wolfpack, you will be able to mock results, only thing though is that the associated field won't be an instance of the model. Im gonna post here once RC2 is ready with those changes. Thanks for sharing your code. |
Associations removed in new v0.3.0 release https://github.com/fdvj/wolfpack/releases/tag/v0.3.0 |
When trying to set a model with associatons am getting the error
The model is
User
and has one modelImage
associatedThe text was updated successfully, but these errors were encountered: