I am trying to include in require.contextWebpack all the files that should be covered by my reporter from Istanbul.
I would like to include / require all files under appthat have no extension .test.js.
const context = require.context('../../app', true, /^.*(?!(\.test|internals.*))\.js$/);
context.keys().forEach(context);
The structure of my files:
app/components/
app/containers/
app/decorators/
app/orm/
app/pages/
app/store/
app/tests/
app/utils/
app/app.js
app/reducers.js
app/routes.js
internals/testing/test-bundler.js
Obviously my regex doesn't work, because inside the coverage report I see all the files .test.jsand even the file internals/testing/test-bundler.js.
What am I doing wrong?
source
share