diff --git a/packages/create-plugin/templates/common/.config/jest.config.js b/packages/create-plugin/templates/common/.config/jest.config.js index 82a6e3f61a..3052a34eca 100644 --- a/packages/create-plugin/templates/common/.config/jest.config.js +++ b/packages/create-plugin/templates/common/.config/jest.config.js @@ -5,6 +5,10 @@ */ module.exports = { + moduleNameMapper: { + "\\.(css|scss|sass)$": "identity-obj-proxy", + }, + setupFilesAfterEnv: ['/jest-setup.js'], testEnvironment: 'jest-environment-jsdom', testMatch: [ '/src/**/__tests__/**/*.{js,jsx,ts,tsx}', @@ -27,5 +31,4 @@ module.exports = { }, ], }, - setupFilesAfterEnv: ['/jest-setup.js'], }; diff --git a/packages/create-plugin/templates/common/package.json b/packages/create-plugin/templates/common/package.json index 4b54ca311a..aff8d0fc02 100644 --- a/packages/create-plugin/templates/common/package.json +++ b/packages/create-plugin/templates/common/package.json @@ -44,6 +44,7 @@ "eslint-plugin-react-hooks": "^4.2.0", "eslint-webpack-plugin": "^3.1.1", "glob": "^8.0.3", + "identity-obj-proxy": "3.0.0", "jest": "27.5.0", "fork-ts-checker-webpack-plugin": "^7.2.0", "prettier": "^2.5.0",