How to run Vuejs tests with without JsDom?

Viewed 672

I have a Vuejs project with Jest and Vue test utils.

Currently I'm running my unit tests in JsDom test environment.

I want to change my test environment to "node", because it's a lot faster and as I understand in latest jest they decided to switch to "node" as well.

But when I set my jest.config.js to

 testEnvironment: 'node',

I start to receive a lot of errors, such as

[vue-test-utils]: window is undefined, vue-test-utils needs to be run in a browser environment.
You can run the tests in node using jsdom

But I guess there should be a way to lunch them with 'node', cause I hardly doubt that jest and the React community decided for that switch with no reason. Feels like I missed a couple of steps.

So, my question is: what should I do to run my test in 'node'?

0 Answers
Related