node-replay
node-replay copied to clipboard
Query parameters ignored when saving fixtures
I have the following API queries for which I want to mock responses:
- http://wpapi.loc/wp-json/wp/v2/posts
- http://wpapi.loc/wp-json/wp/v2/posts?page=2
- http://wpapi.loc/wp-json/wp/v2/posts?filter[tag]=title
- http://wpapi.loc/wp-json/wp/v2/posts?filter[tag]=codex%2Btemplate
- http://wpapi.loc/wp-json/wp/v2/posts?filter[category_name]=markup
Despite this text in the node-replay readme:
All responses are stored as text files using the simplest format ever […]
- First comes the request path (including query string)
with REPLAY=record
, each variant is not stored as a separate request file: I only get one file, set to the query http://wpapi.loc/wp-json/wp/v2/posts
, and replaying the requests for the query string variants throws an error. Unless I can replay multiple responses from the same endpoint, based on query string, replay isn't going to do my application a lot of good.
Is there a way to get Replay to record responses inclusive of query strings?
Version details: Latest version of replay & superagent