vigetlabs / microcosm

Flux with actions at center stage. Write optimistic updates, cancel requests, and track changes with ease.
http://code.viget.com/microcosm/
MIT License
487 stars 22 forks source link

Increase coverage for microcosm-http #503

Closed nhunzaker closed 6 years ago

nhunzaker commented 6 years ago

microcosm-http's coverage was low and I wanted to experiment with what a test adapter would look like for mocking HTTP requests. Pretty neat stuff. I'm curious if we could use a fake axios adapter in collaboration with micromanage to mock API calls to CRUD resources.

How it works

The axios http library, used by microcosm-http, allows for custom adapters for XHR requests. I'm using this to control for HTTP requests when testing.

codecov-io commented 6 years ago

Codecov Report

Merging #503 into master will increase coverage by 4.47%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #503      +/-   ##
==========================================
+ Coverage   95.21%   99.69%   +4.47%     
==========================================
  Files          27       27              
  Lines         669      658      -11     
  Branches      130      129       -1     
==========================================
+ Hits          637      656      +19     
+ Misses         29        2      -27     
+ Partials        3        0       -3
Impacted Files Coverage Δ
packages/microcosm-http/src/http.js 100% <100%> (+100%) :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 80d4f62...4626940. Read the comment docs.