Any way to avoid memory leaks with shallowMount in vue-test-utils?









up vote
2
down vote

favorite
1












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!










share|improve this question























  • 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















up vote
2
down vote

favorite
1












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!










share|improve this question























  • 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













up vote
2
down vote

favorite
1









up vote
2
down vote

favorite
1






1





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!










share|improve this question















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 19 hours ago

























asked 21 hours ago









artnikpro

2,41512327




2,41512327











  • 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
















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


















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















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



































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes















 

draft saved


draft discarded















































 


draft saved


draft discarded














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














































































Popular posts from this blog

How to how show current date and time by default on contact form 7 in WordPress without taking input from user in datetimepicker

Syphilis

Darth Vader #20