http-snapshotter 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -41,7 +41,7 @@ In this mode, http-snapshotter will prevent any real HTTP calls from happening b
|
|
|
41
41
|
|
|
42
42
|
There is also a `SNAPSHOT=ignore` option to neither read nor write from snapshot files and do real network requests instead. This could be useful while writing a new test.
|
|
43
43
|
|
|
44
|
-
Tip: When you do `SNAPSHOT=update` to create snapshots, run it against a single test, so you know what exact snapshots that one test created.
|
|
44
|
+
Tip: When you do `SNAPSHOT=update` to create snapshots, run it against a single test, so you know what exact snapshots that one test created/updated.
|
|
45
45
|
|
|
46
46
|
Finally after getting all your tests to use snapshots, run your test runner against all your tests and then take a look at `<snapshots directory>/unused-snapshots.log` file to see which snapshot files haven't been used by your final test suite. You can delete unused snapshot files.
|
|
47
47
|
|
|
@@ -49,8 +49,8 @@ The tests of this library uses this library itself, check the `tests/` directory
|
|
|
49
49
|
|
|
50
50
|
## About snapshot files and its names
|
|
51
51
|
|
|
52
|
-
A snapshot file name
|
|
53
|
-
|
|
52
|
+
A snapshot file name uniquely identifies a request. By default it is a combination of HTTP method + URL + body that makes a request unique.
|
|
53
|
+
A SHA256 hash of concatenated HTTP method + URL + body makes the file name suffix.
|
|
54
54
|
|
|
55
55
|
However you may want to specially handle some requests. e.g. DynamoDB calls also need the `x-amz-target` header to uniquely identify the request,
|
|
56
56
|
because every call is a POST call with DynamoDB. You can add logic to create better snapshot files for this case:
|