[Vuejs]-Test suite takes too long to finish with Jest

0👍

To anyone who encounters this,
i was able to solve it by simply adding the below code in afterEach.

make sure to

  • call jest.restoreAllMocks(); if you used spy feature of jest.
  • call wrapper.destroy() to destroy wrapper after each tests.
  • call mock.resetHistory() if you are using axios mock
 afterEach(() => {
    jest.restoreAllMocks();
    wrapper.destroy();
    mock.resetHistory();
 });

Leave a comment