JayNewlin (5) [Avatar] Offline
#1
Hi! I'm at the beginning of Chapter 5. I cloned the vue-email-signup-form-app project to a directory at the same level as the main project (i.e., the signup-form-app is not a subdirectory of the Hacker News project). I checked out the starter branch. I ran npm install. The initial test(s) won't run. The output reports that there's an unexpected identifier when trying to import the Modal into the test. The error output reads

/Users/jnewlin/projects/vue_testing/vue-email-signup-form-app/src/components/__tests__/Modal.spec.js:1
({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,global,jest){import Modal from '../../../src/components/Modal.vue';
^^^^^

SyntaxError: Unexpected identifier

at ScriptTransformer._transformAndBuildScript (node_modules/jest/node_modules/jest-cli/node_modules/jest-runtime/build/script_transformer.js:403:17)

Any thoughts on what is missing?

Edd Yerburgh (42) [Avatar] Offline
#2
Hi Jay,

I'm sorry that you're having this issue. I can't replicate on my machine, but I see that it's a common error message from Jest. Did you try removing node_modules and reinstalling?