From a1e270ac13597ce477d426a592f734e687a903b7 Mon Sep 17 00:00:00 2001 From: Glen Davies Date: Mon, 27 Feb 2023 14:09:23 +1300 Subject: [PATCH] Mock scss imports in jest --- projects/plugins/jetpack/tests/jest.config.extensions.js | 4 ++++ projects/plugins/jetpack/tests/styles-mock.js | 1 + 2 files changed, 5 insertions(+) create mode 100644 projects/plugins/jetpack/tests/styles-mock.js diff --git a/projects/plugins/jetpack/tests/jest.config.extensions.js b/projects/plugins/jetpack/tests/jest.config.extensions.js index b9a0b0f5a5509..1939d384aada3 100644 --- a/projects/plugins/jetpack/tests/jest.config.extensions.js +++ b/projects/plugins/jetpack/tests/jest.config.extensions.js @@ -8,4 +8,8 @@ module.exports = { ...baseConfig.testPathIgnorePatterns, 'extensions/shared/test/block-fixtures.js', ], + moduleNameMapper:{ + ...baseConfig.moduleNameMapper, + "\\.(css|less|sass|scss)$": "/tests/styles-mock.js", + } }; diff --git a/projects/plugins/jetpack/tests/styles-mock.js b/projects/plugins/jetpack/tests/styles-mock.js new file mode 100644 index 0000000000000..f053ebf7976e3 --- /dev/null +++ b/projects/plugins/jetpack/tests/styles-mock.js @@ -0,0 +1 @@ +module.exports = {};