Closed M3psipax closed 2 years ago
Hey @kiaking I reverted the changes to belongs_to_retrieve.spec.ts
and created a new spec for it. I called it eager_loads
instead of recursive
because it does not only test withAllRecursive()
, but also withAll()
.
If you run the test, you'll see that one is failing at: https://github.com/M3psipax/vuex-orm-next/blob/97e6ee8af47dfbb25e53127fa6d4ef43cbb3a297/test/feature/relations/eager_loads/eager_loads.spec.ts#L67
When loading only top level relations, I would expect all further relations to be filled with null
, just as they would be when loading only a specific relation on an object using with("relation")
. However, they seem to be undefined
instead. I'm not sure why that is. Can I get some help there?
@M3psipax i wouldn't worry about the relations being undefined, that's a wider concern as mentioned in #96.
Okay, I adjusted the test to allow undefined
for that.
Merging #94 (5963742) into master (e203096) will not change coverage. The diff coverage is
100.00%
.
@@ Coverage Diff @@
## master #94 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 36 38 +2
Lines 1122 1175 +53
Branches 164 172 +8
=========================================
+ Hits 1122 1175 +53
Impacted Files | Coverage Δ | |
---|---|---|
src/query/Query.ts | 100.00% <100.00%> (ø) |
|
src/repository/Repository.ts | 100.00% <100.00%> (ø) |
|
src/model/Model.ts | 100.00% <0.00%> (ø) |
|
src/model/attributes/relations/MorphOne.ts | 100.00% <0.00%> (ø) |
|
.../model/decorators/attributes/relations/MorphOne.ts | 100.00% <0.00%> (ø) |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update e203096...5963742. Read the comment docs.
Hey, thanks for merging. When is the next release planned?
As soon as the docs for this feature is ready, we can release a new version 👍
👀 @cuebit 😃
Type of PR:
Breaking changes:
Details
Adds
withAll()
andwithAllRecursive()
utility methods to fetch all relationships on a model.Still needs a lot more unit tests though.