Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor passthrough response handler away from localstorage specific code and toward a pluggable architecture #175

Open
2 tasks
Tracked by #172
trek opened this issue Oct 4, 2016 · 0 comments

Comments

@trek
Copy link
Member

trek commented Oct 4, 2016

Part of #172, which contains lots of explanatory
writing to make this PR more approachable by those new to Pretender. Check that Issue out!


This is a followup Issue to #172. Now that Localstorage recording is working, it's time to get this feature ready for more use cases.

If it isn't already, please turn the code used to store responses in Localstorage into more of an adapter-style interface. Know the future outputs here will be handy. Off the top of my head I can think of:

  • LocalStore: record responses and stash them in localstorage so they persist between requests
  • StringStore: emit to some location (console?) the code a developer would have written to hand-craft this with instructions about where to this function
  • FileStore: with a tool like Chrome Devtools Workspaces, write these files into some configurable location for a user.

You don't need to craft the latter two adapters, just keep these use cases (and others presented in the comments) in mind as you design an adapter interface and convert the localstorage code to use it!

A PR that completes this Issue will:

  • not change existing localstorage behavior
  • refactor localstorage into an adapter whose interface can be used to solve other recording/playback solutions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant