Skip to content
This repository has been archived by the owner on Mar 26, 2018. It is now read-only.

sketching out the core API #1

Merged
merged 19 commits into from
Sep 7, 2017
Merged

sketching out the core API #1

merged 19 commits into from
Sep 7, 2017

Conversation

shiftkey
Copy link
Owner

@shiftkey shiftkey commented Sep 7, 2017

I spent a bunch of time with mleech/scotch yesterday and learned a bunch, but wanted to start from scratch with consuming the vcr on-disk format rather than remembering how to F# all over again.

Goals to prove out in tests:

  • get this running on appveyor
  • read a cached JSON representation out to disk when it exists
  • for a missing request, store the received response to disk as JSON
  • for an updated test, append the new request to the array and store it to disk

After that, I'll start breaking this up into a proper API.

  • write a readme
  • write some example code

Other interesting formats that might be useful here are nock (example fixtures) but this is a slightly different variant on JSON storage, so I'm trying to make this as pluggable as possible while it's early on.

I also want to borrow the use of a VCR_MODE environment variable that philscatz/fetch-vcr uses to control the runtime behaviour of tests.

  • playback: (default) only uses the local fixture files
  • cache: tries to use the recorded response and if not found then it is fetched and then saved (useful when adding new tests)
  • record: forces HTTP requests and responses are saved to the filesystem (useful for regenerating all the fixtures)

This means one unified implementation, rather than swapping things out on-the-fly in tests.

@shiftkey shiftkey changed the title [WIP] sketching out the core API sketching out the core API Sep 7, 2017
@shiftkey shiftkey merged commit 2f93e2c into master Sep 7, 2017
@shiftkey shiftkey deleted the sketching-out-api branch September 7, 2017 05:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant