Skip to content
Snippets Groups Projects
Commit be469861 authored by Jack Reed's avatar Jack Reed
Browse files

enable css to be directly imported/mocked into components for unit testing in jest

parent a0ab72a1
No related branches found
No related tags found
No related merge requests found
module.exports = {};
...@@ -5,6 +5,9 @@ ...@@ -5,6 +5,9 @@
], ],
"coverageDirectory": "<rootDir>/coverage", "coverageDirectory": "<rootDir>/coverage",
"coverageReporters": ["html", "lcov"], "coverageReporters": ["html", "lcov"],
"moduleNameMapper": {
"\\.css$": "<rootDir>/__mocks__/css.js"
},
"setupFiles": [ "setupFiles": [
"<rootDir>/setupJest.js" "<rootDir>/setupJest.js"
], ],
......
...@@ -73,7 +73,7 @@ const baseConfig = [ ...@@ -73,7 +73,7 @@ const baseConfig = [
eslintLoaderConfig, eslintLoaderConfig,
babelLoaderConfig, babelLoaderConfig,
{ {
test: /\.scss$/, test: /\.s?css$/,
use: [ use: [
'style-loader', // creates style nodes from JS strings 'style-loader', // creates style nodes from JS strings
'css-loader', // translates CSS into CommonJS 'css-loader', // translates CSS into CommonJS
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment