Skip to content

Commit

Permalink
fix: Syntax Error: Invalid or unexpected token with .png
Browse files Browse the repository at this point in the history
  • Loading branch information
kengo nakamura committed Apr 27, 2018
1 parent a0a7dc6 commit 5daf42b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
9 changes: 6 additions & 3 deletions packages/@vue/cli-plugin-unit-jest/generator/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ module.exports = api => {
],
'transform': {
// process *.vue files with vue-jest
'^.+\\.vue$': 'vue-jest'
'^.+\\.vue$': 'vue-jest',
'.+\\.(css|styl|less|sass|scss|png|jpg|ttf|woff|woff2)$': 'jest-transform-stub'
},
// support the same @ -> src alias mapping in source code
'moduleNameMapper': {
Expand All @@ -40,7 +41,8 @@ module.exports = api => {
devDependencies: {
'babel-jest': '^22.0.4',
// this is for now necessary to force babel-jest and vue-jest to use babel 7
'babel-core': '^7.0.0-0'
'babel-core': '^7.0.0-0',
'jest-transform-stub': '^1.0.0'
}
})
} else {
Expand All @@ -55,7 +57,8 @@ module.exports = api => {
api.extendPackage({
devDependencies: {
// this is for now necessary to force ts-jest and vue-jest to use babel 7
'babel-core': '^7.0.0-0'
'babel-core': '^7.0.0-0',
'jest-transform-stub': '^1.0.0'
}
})
}
Expand Down
3 changes: 2 additions & 1 deletion packages/@vue/cli-plugin-unit-jest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"devDependencies": {
"@vue/test-utils": "^1.0.0-beta.10",
"babel-jest": "^22.0.4",
"ts-jest": "^22.0.1"
"ts-jest": "^22.0.1",
"jest-transform-stub": "^1.0.0"
}
}

0 comments on commit 5daf42b

Please sign in to comment.