Closed aweary closed 6 years ago
Merging #242 into master will increase coverage by
0.42%
. The diff coverage is100%
.
@@ Coverage Diff @@
## master #242 +/- ##
==========================================
+ Coverage 98.44% 98.87% +0.42%
==========================================
Files 19 19
Lines 258 266 +8
==========================================
+ Hits 254 263 +9
+ Misses 4 3 -1
Impacted Files | Coverage Δ | |
---|---|---|
src/enhancer.js | 100% <100%> (+5.55%) |
:arrow_up: |
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 207222c...5c2817b. Read the comment docs.
I had some trouble testing changes made to one of these callbacks in https://github.com/FormidableLabs/redux-little-router/pull/240, so here's a small refactor that makes them a bit more testable. This PR:
Stops defining the callbacks as inline arrow functions and implements
createStoreSubscriber
andcreateHistoryListener
instead. These functions accept some constant dependencies (likestore
) and return functions that can be called with the dynamic values likecurrentMatcher
Adds tests for both of those new functions
I'm not sure it's the best solution but it seems sufficient to me 🤷♂️