Any way to avoid memory leaks with shallowMount in vue-test-utils?
up vote
1
down vote
favorite
We have a custom unit testing setup for vue that works on Node, Mocha and jsdom package which simulates browser environment (no webpack, karma). We have wrote about 3k specs already (big app with hundreds of components), and now when mocha is running it becomes slower and slower, and eventually the process just hangs. We thought that maybe there is a memory leak in "jsdom", so we changed it to a "domino" (alternative package), but it still hangs.
We checked the heap memory usage and it just keeps growing (up to 1.5 GB!).
So we think that the problem is with either vue or vue-test-utils. It looks like each time we use mount
/shallowMount
it needs to be destroyed/unmounted after each test to release memory?
Any ideas? Thanks in advance!
vue.js vuejs2 vue-test-utils
add a comment |
up vote
1
down vote
favorite
We have a custom unit testing setup for vue that works on Node, Mocha and jsdom package which simulates browser environment (no webpack, karma). We have wrote about 3k specs already (big app with hundreds of components), and now when mocha is running it becomes slower and slower, and eventually the process just hangs. We thought that maybe there is a memory leak in "jsdom", so we changed it to a "domino" (alternative package), but it still hangs.
We checked the heap memory usage and it just keeps growing (up to 1.5 GB!).
So we think that the problem is with either vue or vue-test-utils. It looks like each time we use mount
/shallowMount
it needs to be destroyed/unmounted after each test to release memory?
Any ideas? Thanks in advance!
vue.js vuejs2 vue-test-utils
I just tried to callwrapper.destroy()
after each test ends on each wrapper we have, didn't make any difference
– artnikpro
Nov 9 at 10:59
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
We have a custom unit testing setup for vue that works on Node, Mocha and jsdom package which simulates browser environment (no webpack, karma). We have wrote about 3k specs already (big app with hundreds of components), and now when mocha is running it becomes slower and slower, and eventually the process just hangs. We thought that maybe there is a memory leak in "jsdom", so we changed it to a "domino" (alternative package), but it still hangs.
We checked the heap memory usage and it just keeps growing (up to 1.5 GB!).
So we think that the problem is with either vue or vue-test-utils. It looks like each time we use mount
/shallowMount
it needs to be destroyed/unmounted after each test to release memory?
Any ideas? Thanks in advance!
vue.js vuejs2 vue-test-utils
We have a custom unit testing setup for vue that works on Node, Mocha and jsdom package which simulates browser environment (no webpack, karma). We have wrote about 3k specs already (big app with hundreds of components), and now when mocha is running it becomes slower and slower, and eventually the process just hangs. We thought that maybe there is a memory leak in "jsdom", so we changed it to a "domino" (alternative package), but it still hangs.
We checked the heap memory usage and it just keeps growing (up to 1.5 GB!).
So we think that the problem is with either vue or vue-test-utils. It looks like each time we use mount
/shallowMount
it needs to be destroyed/unmounted after each test to release memory?
Any ideas? Thanks in advance!
vue.js vuejs2 vue-test-utils
vue.js vuejs2 vue-test-utils
edited Dec 7 at 9:17
asked Nov 9 at 10:37
artnikpro
2,47312427
2,47312427
I just tried to callwrapper.destroy()
after each test ends on each wrapper we have, didn't make any difference
– artnikpro
Nov 9 at 10:59
add a comment |
I just tried to callwrapper.destroy()
after each test ends on each wrapper we have, didn't make any difference
– artnikpro
Nov 9 at 10:59
I just tried to call
wrapper.destroy()
after each test ends on each wrapper we have, didn't make any difference– artnikpro
Nov 9 at 10:59
I just tried to call
wrapper.destroy()
after each test ends on each wrapper we have, didn't make any difference– artnikpro
Nov 9 at 10:59
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53224101%2fany-way-to-avoid-memory-leaks-with-shallowmount-in-vue-test-utils%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
I just tried to call
wrapper.destroy()
after each test ends on each wrapper we have, didn't make any difference– artnikpro
Nov 9 at 10:59