FormidableLabs / redux-little-router

A tiny router for Redux that lets the URL do the talking.
MIT License
1.04k stars 114 forks source link

Include parsed query in all history listener dispatches #240

Closed aweary closed 6 years ago

aweary commented 6 years ago

Second part of the fix outlined in https://github.com/FormidableLabs/redux-little-router/issues/211#issuecomment-338770696

@tptee I couldn't figure out an easy way to test this. enhancer.spec.js is mocking dispatch for the store created by the createStore call in the test file, but it isn't mocking the store that's creating inside the enhancer. To test this we'd probably want to somehow mock that internal store and assert that it's dispatching the correct payload for POP actions, but I can't figure out a clean way to do that 🤔 That history.listen callback depends on the dynamic currentMatcher variable in the parent scope so refactoring is kind of tricky.

codecov[bot] commented 6 years ago

Codecov Report

Merging #240 into master will increase coverage by <.01%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #240      +/-   ##
==========================================
+ Coverage   98.44%   98.44%   +<.01%     
==========================================
  Files          19       19              
  Lines         257      258       +1     
==========================================
+ Hits          253      254       +1     
  Misses          4        4
Impacted Files Coverage Δ
src/enhancer.js 94.44% <100%> (+0.32%) :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 2dbd876...1a4e2b5. Read the comment docs.