-
Notifications
You must be signed in to change notification settings - Fork 157
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
Fix removing old nodes from parent #428
Conversation
Wow that was fast. Thanks! will review soon |
Codecov Report
@@ Coverage Diff @@
## master #428 +/- ##
=======================================
Coverage 64.96% 64.96%
=======================================
Files 52 52
Lines 8278 8278
=======================================
Hits 5378 5378
Misses 2900 2900
Continue to review full report at Codecov.
|
Oh the empty mock functions are causing the decrease in coverage 😞 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think instead of creating a new MockNode
, it would be cleaner to just re-use SsrNode
which is what most other tests do. Since sycamore
depends on sycamore-core
, we can't add sycamore
as a dependency but we can add it as a dev-dependency. Unfortunately, rust-analyzer doesn't seem to recognize that but at least it compiles fine.
Cleaner yes, but I worry about adding point of failures to a unit test that have nothing to do with the function under test - this test may fail because of changes made in the Also I seem to have trouble with compiling the test as the The other points I've done locally so no issue there :) |
Yeah that's a valid concern but since none of the methods for |
If you prefer, I can change this PR to do the simple bug fix (add the The motivation for the mocking was as a future base for further testing the |
Alright that sounds like a good idea. Also there are some tests for |
f3affca
to
7763073
Compare
Fixes #427
The #427 bug was introduced in #416 inside the
reconcile_fragments
function.The quick fix was to add the negation that got dropped during that change - this seems
to have caused the bug.
I instead extracted the removal of nodes from the parent node part of the
reconcile_fragments
function to a new function and added tests for this newfunction to avoid any future regressions.
The tests use a pretty rough/bare bones mock of aGenericNode
in order to satisfy thetrait bounds required by the extracted function. I think the tests are worth the added file
noise of the mock but let me know if you'd prefer I remove it (and probably the extracted
function at that point).