Skip to content

Commit 20c23a8

Browse files
author
kengo nakamura
committed
fix: Syntax Error: Invalid or unexpected token with .png
1 parent a0a7dc6 commit 20c23a8

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

packages/@vue/cli-plugin-unit-jest/generator/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ module.exports = api => {
1919
],
2020
'transform': {
2121
// process *.vue files with vue-jest
22-
'^.+\\.vue$': 'vue-jest'
22+
'^.+\\.vue$': 'vue-jest',
23+
'.+\\.(css|styl|less|sass|scss|png|jpg|ttf|woff|woff2)$': 'jest-transform-stub'
2324
},
2425
// support the same @ -> src alias mapping in source code
2526
'moduleNameMapper': {

packages/@vue/cli-plugin-unit-jest/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"execa": "^0.9.0",
2626
"jest": "^22.4.3",
2727
"jest-serializer-vue": "^1.0.0",
28+
"jest-transform-stub": "^1.0.0",
2829
"vue-jest": "^2.5.0"
2930
},
3031
"devDependencies": {

0 commit comments

Comments
 (0)