You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The v3 format is encoded using CBOR. It contains all information necessary to regenerate the report file. This allows for snapshots to be updated even if tests or assertions are skipped.
This is not backwards compatible with the v2 format used in AVA 3.
Co-authored-by: Mark Wubben <[email protected]>
Copy file name to clipboardExpand all lines: docs/01-writing-tests.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -120,7 +120,7 @@ You can use the `.only` modifier with all tests. It cannot be used with hooks or
120
120
121
121
*Note:* The `.only` modifier applies to the test file it's defined in, so if you run multiple test files, tests in other files will still run. If you want to only run the `test.only` test, provide just that test file to AVA.
122
122
123
-
You cannot update snapshots when using `.only()`.
123
+
In AVA 3, you cannot update snapshots when using `.only()`.
124
124
125
125
## Skipping tests
126
126
@@ -134,7 +134,9 @@ test.skip('will not be run', t => {
134
134
135
135
You must specify the implementation function. You can use the `.skip` modifier with all tests and hooks, but not with `.todo()`. You can not apply further modifiers to `.skip`.
136
136
137
-
You cannot update snapshots when using `.skip()`. If the test is likely to be failing for a while, use `.failing()` instead.
137
+
If the test is likely to be failing for a while, use `.failing()` instead.
138
+
139
+
In AVA 3, you cannot update snapshots when using `.skip()`.
Copy file name to clipboardExpand all lines: docs/03-assertions.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -337,7 +337,7 @@ Compares the `expected` value with a previously recorded snapshot. Snapshots are
337
337
338
338
AVA 3 supports an `options` object that lets you select a specific snapshot, for instance `{id: 'my snapshot'}`. This is buggy and will be removed in AVA 4.
339
339
340
-
Snapshot assertions cannot be skipped when snapshots are being updated.
340
+
In AVA 3, you cannot update snapshots while using `t.snapshot.skip()`.
Copy file name to clipboardExpand all lines: docs/04-snapshot-testing.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,6 +44,8 @@ You can then check your code. If the change was intentional you can use the `--u
44
44
$ ava --update-snapshots
45
45
```
46
46
47
+
In AVA 4, if you need to update snapshots for only a particular test, you can use `--update-snapshots` together with e.g. `--match` or `.only()` to select the test.
48
+
47
49
You can specify a fixed location for storing the snapshot files in AVA's [`package.json` configuration](./06-configuration.md):
0 commit comments