I want karma to completely ignore / not care / not pay attention to style files.
I have the following in my webpack configuration, which causes webpack not to import files during build.
plugins: [
new webpack.IgnorePlugin(/\.(less|scss)$/),
new webpack.IgnorePlugin(/client\/utils/),
],
However, when Karma starts up, it tries to import, which, of course, will fail:
Uncaught Error: Cannot find module "./view.scss"
I tried to add very strongly the exception swapping to the karma configuration
exclude: [
{
pattern: '**/*.less',
type: 'module',
},
{
pattern: '**/*.scss',
type: 'module',
},
]
And I tried ignore-styles (which throws an error out of the box).
I just want it to skip stylesheets because they have nothing to do with tests and just waste time. I don’t understand how so complicated it is.
Error Project Example
https://github.com/jshado1/fetch-mock-test
(, npm install ).
:
Uncaught Error: Cannot find module "./test.scss" at webpack: