Commit 7f8aa875 authored by Illya Klymov's avatar Illya Klymov

Merge branch 'vs-doc-remove-note-about-wrapper-null' into 'master'

Remove note about nullifying the wrapper

See merge request gitlab-org/gitlab!54715
parents e478477e 914b769b
......@@ -539,21 +539,6 @@ When looking at this initially you'd suspect that the component is setup before
This is however not entirely true as the `destroy` method does not remove everything which has been mutated on the `wrapper` object. For functional components, destroy only removes the rendered DOM elements from the document.
In order to ensure that a clean wrapper object and DOM are being used in each test, the breakdown of the component should rather be performed as follows:
```javascript
afterEach(() => {
wrapper.destroy();
wrapper = null;
});
```
<!-- vale gitlab.Spelling = NO -->
See also the [Vue Test Utils documentation on `destroy`](https://vue-test-utils.vuejs.org/api/wrapper/#destroy).
<!-- vale gitlab.Spelling = YES -->
### Jest best practices
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/34209) in GitLab 13.2.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment