Skip to content

Commit 4793cb9

Browse files
committed
docs: update again
1 parent 14e9184 commit 4793cb9

1 file changed

Lines changed: 13 additions & 7 deletions

File tree

tools/apitester/README.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,6 @@ Each cassette is a YAML file in `testdata/cassettes` that stores an array of
1818
Of these, the tool only uses the `request` field, and the `response` field will
1919
be automatically removed as part of running tool.
2020

21-
The `request` in each interaction for a cassette is replayed and the response
22-
body captured as a snapshot for the particular cassette using
23-
[`go-snaps`](https://github.com/gkampitakis/go-snaps) - subsequent runs will
24-
compare the response body with the existing snapshot and show a diff of any
25-
differences.
26-
2721
## Usage
2822

2923
As this tool uses packages intended for being used in tests, it must be run
@@ -33,8 +27,20 @@ using `go test`:
3327
go test ./...
3428
```
3529

36-
You can regenerate snapshots by setting `UPDATE_SNAPS=true` when running tests:
30+
This replays each recorded `request` in `testdata/cassettes` and capture the
31+
response body as a snapshot using
32+
[`go-snaps`](https://github.com/gkampitakis/go-snaps); subsequent runs will
33+
compare the response body with the existing snapshot and report any differences.
34+
35+
By default, any differences in existing snapshots will be considered a failure -
36+
you can have the snapshots updated instead by setting `UPDATE_SNAPS=true`:
3737

3838
```shell
3939
UPDATE_SNAPS=true go test ./...
4040
```
41+
42+
Before the test suite is actually run, the cassettes will be "cleaned" so that
43+
44+
- the `body` of each `request` will be formatted as a multi-line string, to make
45+
it easier to understand what the query parameters are
46+
- the `response` is property is not present, to reduce the size of each cassette

0 commit comments

Comments
 (0)