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
* Move files around
* Documentation
* Add in different data types
* Have Travis verify Node support
* Force npm version in Travis
* Improve stringify
* EOL
* Bump and Deps
* segregate date because travis
* Prevent test bleed
Copy file name to clipboardExpand all lines: README.md
+8-4Lines changed: 8 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -211,7 +211,9 @@ module.exports = {
211
211
removeDataVId:true,
212
212
removeIdTest:false,
213
213
removeServerRendered:true,
214
-
stringifyObjects:false
214
+
addInputValues:false,
215
+
stringifyObjects:false,
216
+
verbose:true
215
217
}
216
218
}
217
219
};
@@ -229,6 +231,8 @@ removeDataQa | `false` | Removes `data-qa="whatever"` from you
229
231
removeDataVId | `true` | Removes `data-v-1234abcd=""` from your snapshots. Important if a 3rd-party component uses scoped styles, to prevent ID changes from breaking your `mount` based tests when updating a dependency.
230
232
removeIdTest | `false` | Removes `id="test-whatever"` or `id="testWhatever"`from snapshots. **Warning:** You should never use ID's for test tokens, as they can also be used by JS and CSS, making them more brittle. Use `data-test-id` instead.
231
233
removeServerRendered | `true` | Removes `data-server-rendered="true"` from your snapshots if true.
234
+
verbose | `true` | Logs to the console errors or other messages if true. **Strongly recommended** if using experimental features.
235
+
addInputValues | `false` | **EXPERIMENTAL** Displays the value of form fields. `<input>` becomes `<input value="whatever">` in your snapshots. Requires you pass in `wrapper`, not `wrapper.html()`. On deeply nested components, it may exceed callstack.
232
236
stringifyObjects | `false` | **EXPERIMENTAL** Replaces `title="[object Object]"` with `title="{a:'asdf'}"` in your snapshots, allowing you to see the data in the snapshot. Requires you to pass in `wrapper`, not `wrapper.html()`. This is still a work in progress. On deeply nested componets, it may exceed callstack.
**How do I opt out of stringifyObjects for one test?** - This is actually much easier. Stringify objects can only be done on a Vue VNode. So if you do `.html()` prior to sending it, it will always skip the `stringifyObjects` code. This allows you to use this experimental feature more easily, while opting out of the more troublesome tests.
301
+
**How do I opt out of stringifyObjects or addInputValues for one test?** - This is actually much easier. These experimetnal features can only be done on a Vue VNode. So if you do `.html()` prior to sending it, it will always skip these transforms. This allows you to use these experimental feature more easily, while opting out of the more troublesome tests.
298
302
299
303
```js
300
304
test('Assuming stringifyObjects is enabled', () => {
301
305
constwrapper=shallowMount(YourComponent);
302
306
303
307
expect(wrapper)
304
-
.toMatchSnapshot('Stringify objects');
308
+
.toMatchSnapshot('Stringify objects and add input values');
305
309
306
310
expect(wrapper.html())
307
-
.toMatchSnapshot('Opt out of stringify objects');
311
+
.toMatchSnapshot('Opt out of stringify objects and adding input values');
0 commit comments