diff --git a/package.json b/package.json index 4f7eb2c5f5..6459abcc5e 100644 --- a/package.json +++ b/package.json @@ -30,6 +30,7 @@ "devDependencies": { "@spotify/eslint-config-oss": "^1.0.1", "husky": "^4.2.3", + "identity-obj-proxy": "^3.0.0", "lerna": "^3.20.2", "lint-staged": "^10.1.0", "prettier": "^2.0.5" diff --git a/packages/cli/config/jest.js b/packages/cli/config/jest.js index 77f345a0dd..7f5f05b212 100644 --- a/packages/cli/config/jest.js +++ b/packages/cli/config/jest.js @@ -28,6 +28,7 @@ if (fs.existsSync('jest.config.js')) { modulePaths: [''], moduleNameMapper: { '\\.(css|less|scss|sss|styl)$': require.resolve('jest-css-modules'), + '.+\\.(png|jpg|ttf|woff|woff2)$': 'identity-obj-proxy', }, // We build .esm.js files with plugin:build, so to be able to load these in tests they need to be transformed // TODO: jest is working on module support, it's possible that we can remove this in the future diff --git a/yarn.lock b/yarn.lock index 6818944223..b8f62a16a3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11169,7 +11169,7 @@ icss-utils@^4.0.0, icss-utils@^4.1.1: dependencies: postcss "^7.0.14" -identity-obj-proxy@3.0.0: +identity-obj-proxy@3.0.0, identity-obj-proxy@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/identity-obj-proxy/-/identity-obj-proxy-3.0.0.tgz#94d2bda96084453ef36fbc5aaec37e0f79f1fc14" integrity sha1-lNK9qWCERT7zb7xarsN+D3nx/BQ=