Skip to content

Commit 3e5fbda

Browse files
Clear attributes
1 parent 4a7a7b2 commit 3e5fbda

File tree

9 files changed

+3417
-2582
lines changed

9 files changed

+3417
-2582
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,8 @@ In your `vue.config.js` file:
193193
module.exports = {
194194
pluginOptions: {
195195
jestSerializer: {
196-
// All available options: https://github.com/beautify-web/js-beautify/blob/master/js/src/html/options.js
196+
attributesToClear: [],
197+
// All available formatting options: https://github.com/beautify-web/js-beautify/blob/master/js/src/html/options.js
197198
formatting: {
198199
indent_char: ' ',
199200
indent_inner_html: true,
@@ -221,6 +222,7 @@ module.exports = {
221222

222223
Setting | Default | Description
223224
:-- | :-- | :--
225+
attributesToClear | [] | Takes an array of attribute strings, like `['title', 'id']`, to remove the values from these attributes. `<input title id class="stuff">`.
224226
formatting | See above example | These options format the snapshot. [See all available options here](https://github.com/beautify-web/js-beautify/blob/master/js/src/html/options.js).
225227
removeClassTest | `false` | Removes all CSS classes that start with "test", `class="test-whatever"`. **Warning:** Don't use this approach. Use `data-test` instead. It is better suited for this because it doesn't conflate CSS and test tokens.
226228
removeComments | `false` | Removes all HTML comments from your snapshots. This is false be default, as sometimes these comments can infer important information about how your DOM was rendered. However, this is mostly just personal preference.

0 commit comments

Comments
 (0)