Any way to avoid memory leaks with shallowMount in vue-test-utils?
up vote
2
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-test-utils
add a comment |
up vote
2
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-test-utils
I just tried to callwrapper.destroy()
after each test ends on each wrapper we have, didn't make any difference
– artnikpro
20 hours ago
add a comment |
up vote
2
down vote
favorite
up vote
2
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-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-test-utils
vue-test-utils
edited 19 hours ago
asked 21 hours ago
artnikpro
2,41512327
2,41512327
I just tried to callwrapper.destroy()
after each test ends on each wrapper we have, didn't make any difference
– artnikpro
20 hours ago
add a comment |
I just tried to callwrapper.destroy()
after each test ends on each wrapper we have, didn't make any difference
– artnikpro
20 hours ago
I just tried to call
wrapper.destroy()
after each test ends on each wrapper we have, didn't make any difference– artnikpro
20 hours ago
I just tried to call
wrapper.destroy()
after each test ends on each wrapper we have, didn't make any difference– artnikpro
20 hours ago
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
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
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
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
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
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
I just tried to call
wrapper.destroy()
after each test ends on each wrapper we have, didn't make any difference– artnikpro
20 hours ago