-
Notifications
You must be signed in to change notification settings - Fork 156
Closed
Labels
Description
Hi all, I have a Typescript file which imports a Vue file. It seems vue-jest doesn't like this?
/path-to-my-project/Autocomplete/Autocomplete.vue:14
import ItemTemplate from './_autocomplete_item.vue';
^^^^^^
SyntaxError: Unexpected token import
> 1 | import Autocomplete from './Autocomplete/Autocomplete.vue';
| ^
at ScriptTransformer._transformAndBuildScript (node_modules/jest-runtime/build/script_transformer.js:403:17)
at Object.<anonymous> (path-to-my-project/base.ts:1:1)
You'll note that it's able to find Autocomplete.vue
, but is unable to parse the import within Autocomplete.vue
.
Here is my jest config; Am I doing something obviously wrong here?
"jest": {
"transform": {
"^.+\\.tsx?$": "ts-jest",
"^.+\\.vue$": "vue-jest"
},
"testRegex": "(\\./test/javascript/.*|\\.(test|spec))\\.(jsx?|tsx?)$",
"moduleFileExtensions": [
"ts",
"tsx",
"vue",
"js",
"jsx",
"json",
"node"
]
}