Gomah / nuxt-shopify

🛍 Seamless Shopify Buy SDK integration with Nuxt.js.
https://nuxt-shopify-docs.vercel.app
MIT License
352 stars 29 forks source link

Jest: node_modules/nuxt-shopify/lib/module.js #691

Open ckhatton opened 2 years ago

ckhatton commented 2 years ago

Hi there

Since installing nuxt-shopify and running npm run test (jest), I am now receiving the error:

[fatal] Cannot use import statement outside a module

Jest failed to parse a file. This happens e.g. when your code or its dependencies use non-standard JavaScript syntax, or when Jest is not configured to support such syntax.

Pointing to the error:

node_modules/nuxt-shopify/lib/module.js:1
({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,jest){import path from 'path';
^^^^^^

I've tried all matter of guides online to ignore it, but I can't suss it out myself.

"core-js": "^3.15.1",
"nuxt": "^2.15.3",
"nuxt-shopify": "^1.12.0"
"babel-core": "7.0.0-bridge.0",
"babel-jest": "^27.0.5",
"jest": "^27.3.1",
Gomah commented 2 years ago

Do you have a small reproduction with your jest configuration?