Closed
Description
Version
2.9.3
Reproduction link
https://gitlab.com/cronobo/vue-e2e-test
Steps to reproduce
- Scaffold app
- Install a library (I tried with vue-octicon and vue-ionicons)
- Import locally this lib into HelloWorld component
npm run dev
works fine, icon is rendered- Yet,
npm run unit
crashes with a weird SyntaxError
What is expected?
No SyntaxError, since html was not even modified
What is actually happening?
> jest --config test/unit/jest.conf.js --coverage
● Deprecation Warning:
Option "mapCoverage" has been removed, as it's no longer necessary.
Please update your configuration.
Configuration Documentation:
https://facebook.github.io/jest/docs/configuration.html
FAIL test\unit\specs\HelloWorld.spec.js
● Test suite failed to run
C:\Users\remib\Gitlab\vue-e2e-test\node_modules\vue-ionicons\dist\md-alert.vue:1
({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,global,jest){<template>
^
SyntaxError: Unexpected token <
6 | <li>
7 | <a
> 8 | href="https://vuejs.org"
9 | target="_blank"
10 | >
11 | Core Docs
at ScriptTransformer._transformAndBuildScript (node_modules/jest-runtime/build/script_transformer.js:316:17)
at src/components/HelloWorld.vue:8:68
at Object.<anonymous> (src/components/HelloWorld.vue:106:3)
Running coverage on untested files...Failed to collect coverage from C:\Users\remib\Gitlab\vue-e2e-test\src\components\HelloWorld.vue
ERROR: Cannot read property 'fileCoverage' of undefined
STACK: TypeError: Cannot read property 'fileCoverage' of undefined
at Instrumenter.instrumentSync (C:\Users\remib\Gitlab\vue-e2e-test\node_modules\istanbul-lib-instrument\dist\instrumenter.js:148:40)
at exports.default (C:\Users\remib\Gitlab\vue-e2e-test\node_modules\jest\node_modules\jest-cli\build\generate_empty_coverage.js:18:18)
at Object.worker (C:\Users\remib\Gitlab\vue-e2e-test\node_modules\jest\node_modules\jest-cli\build\reporters\coverage_worker.js:48:84)
at execMethod (C:\Users\remib\Gitlab\vue-e2e-test\node_modules\jest-worker\build\child.js:92:29)
at process.on (C:\Users\remib\Gitlab\vue-e2e-test\node_modules\jest-worker\build\child.js:42:7)
at emitTwo (events.js:126:13)
at process.emit (events.js:214:7)
at emit (internal/child_process.js:772:12)
at _combinedTickCallback (internal/process/next_tick.js:141:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
----------|----------|----------|----------|----------|-------------------|
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s |
----------|----------|----------|----------|----------|-------------------|
All files | Unknown | Unknown | Unknown | Unknown | |
----------|----------|----------|----------|----------|-------------------|
Test Suites: 1 failed, 1 total
Tests: 0 total
Snapshots: 0 total
Time: 3.719s
Ran all test suites.