I keep my tests in the same folder as my components, and I'm trying to apply a webpack loader (istanbul-instrumenter-loader
) to all files except the ones called exactly spec.js
or that end with *Spec.js
(so both components/SupportPage/spec.js
and actions/SupportActionsSpec.js
won't get included. I've tried getting a correct RegEx on regextester.com but I can't get it to work. Am I missing something?
Ok, I found it. Writing a single test to include all files, but exclude the specific spec files was maybe the wrong approach, I solved it like this:
{
test: /.\.js$/,
exclude: /(node_modules|bower_components)\/|.[sS]pec\.js$/,
loader: 'istanbul-instrumenter'
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With