Closed brandongregoryscott closed 3 years ago
@myty I believe unmount()
returned from a render()
is the proper thing to force an unmount at a specific point. I've not seen cleanup
used in our codebase yet. It looks like test runners that support afterEach
hooks will call this automatically, so we don't need to worry about memory leaks/manual cleanup. https://testing-library.com/docs/react-testing-library/setup/#skipping-auto-cleanup
Merging #58 (89e3351) into main (c5d148b) will not change coverage. The diff coverage is
n/a
.
@@ Coverage Diff @@
## main #58 +/- ##
=======================================
Coverage 94.62% 94.62%
=======================================
Files 16 16
Lines 242 242
Branches 27 27
=======================================
Hits 229 229
Misses 12 12
Partials 1 1
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 c5d148b...9e4d380. Read the comment docs.
Fixes #50 use-async-effect.ts test flakes
Update use-async-effect tests to call 'unmount' function returned by component render, vs. relying on globally provided 'cleanup' function