Comments (1)
Hey @mabashian. The issue you are having is because your code executes asynchronously. Even though you set the results correctly, wolfpack cannot determine which promise is fulfilled first, so by the time the Cat promise executes, the clearResults for the Dog already executed and the setFindResults for it as well. In this case, you must clear and set the results asynchronously as well for the tests
beforeEach(function(done){
wolfpack.clearResults();
wolfpack.setFindResults({
dogId: 1,
type: 'Lab'
});
done();
});
You can also set the results directly above the Dog.findOne lines.
from wolfpack.
Related Issues (15)
- TOC for README HOT 1
- Wolfpack works with waterline associations? HOT 4
- Support Associations HOT 2
- TypeError: Cannot read property 'find' of undefined HOT 3
- Is it possible to use populate('something') with wolfpack? HOT 2
- My Controller calls a Service, how do I mock or test that? HOT 4
- Is there a way to test the model's unique field attribute with this?
- Is there any option to test sails native() methods using wolfpack?
- Wolfpack doesn't work with sails 1.0, global doesn't work with node 14.1.0
- Add support for selecting which errors to clear
- Provide a spy and accessor for intantiated models from classes
- Why not use Mocha instead of Jasmine? HOT 1
- Update waterline for Sails 0.10.x HOT 3
- Still doesn't work at 0.10.x HOT 15
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wolfpack.