test-utils icon indicating copy to clipboard operation
test-utils copied to clipboard

Installed Nuxt as stated in the documentation but issue with jest-preset.js

Open ibraheemosule opened this issue 3 years ago • 4 comments

After installing and setting up nuxt test utils as stated in the docs, I get an error saying 'Module @nuxt/test-utils should have "jest-preset.js" or "jest-preset.json" file at the root.' when I run yarn test

ibraheemosule avatar Jul 05 '22 06:07 ibraheemosule

I have the same issue with the following dependency versions:

  • @nuxt/test-utils: 3.0.0-rc.5
  • jest: 28.1.3
  • nuxt: 3.0.0-rc.5

kihayu avatar Jul 15 '22 10:07 kihayu

I had the same problem. You need to downgrade to "@nuxt/test-utils": "0.2.2". And it works.

YannisHaismann avatar Jul 19 '22 13:07 YannisHaismann

I had the same problem. You need to downgrade to "@nuxt/test-utils": "0.2.2". And it works.

Tried your solution but having a different error of:

$ jest
[fatal] You need to run with a version of node that supports ES Modules in the VM API. See https://jestjs.io/docs/ecmascript-modules
 ...
[fatal] Cannot read properties of undefined (reading 'close')
 ...

jcjp avatar Jul 21 '22 09:07 jcjp

Yup, I can confirm this being the case for me as well.

Cephra avatar Sep 07 '22 17:09 Cephra