Fix test/include.test.js
- Dominant language
- JavaScript
- Stars
- 2k
- Forks
- 238
- PR merge metrics
- No merged PRs in 30d
Description
In my pull request for jugglindb-redis (see https://github.com/jugglingdb/redis-adapter/pull/3), I noticed that the include.test.js is not properly testing the cached relations for included models.
For example:
``` javascript
u.__cachedRelations.should.have.property('posts');
u.__cachedRelations.posts.forEach(function(p) {
p.userId.should.equal(u.id);
});
```
`p.userId.should.equal(u.id)` will never be checked if `u.__cachedRelations.posts == []`, thus the test will pass. Without comparing the query results to the mocked models, the tests can't check if the cached relations _should_ contain results.
I will submit a pull request when I find time, but I thought I should point it out, as many adapters could be erroneously passing the include tests.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.