diff --git a/jest.config.js b/jest.config.js index 274d7f1..536f845 100644 --- a/jest.config.js +++ b/jest.config.js @@ -37,6 +37,7 @@ module.exports = { tsconfig: './tsconfig.test.json', }, ], + '.+\\.(css|styl|less|sass|scss|png|jpg|ttf|woff|woff2)$': 'jest-transform-stub', }, // 定义了忽略进行 jest 执行的依赖包 diff --git a/package.json b/package.json index 637365b..1051a04 100644 --- a/package.json +++ b/package.json @@ -52,6 +52,7 @@ "eslint-plugin-import": "^2.22.0", "husky": "^8.0.3", "jest": "^29.5.0", + "jest-transform-stub": "^2.0.0", "lint-staged": "^13.1.0", "prettier": "^2.8.3", "prismjs": "^1.29.0",