Simple recording & replaying of HTTP requests for predictable development & testing.
Example
Given a GraphQL server:
;; { // 👇 Pull ?mode=record or ?mode=replay const mode = reqquery; // 👇 Create a recorder for this request mode ; return graphiql: true pretty: true schema ;};
- Record network calls – http://localhost:3000/?mode=record
- Replay network calls - http://localhost:3000/?mode=replay
Fixtures are stored based on their URL with the name ${hash}.${user}.json
:
.
└── __fixtures__
└── api.github.com
└── rate_limit
└── 4280543676.all.json
This way, similar requests for different users/logins in your testing can be easily found.
Installation
yarn add --dev back-to-the-fixture