Component testing code coverage - parameters not read from package.json #18012
Unanswered
yann-combarnous
asked this question in
Component Testing
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I am currently on CRA and instrumenting my code with:
`
// Component testing web dev server setup for code coverage
if (config.testingType === 'component') {
const webpackConfig = findReactScriptsWebpackConfig(config);
const rules = webpackConfig.module.rules.find((rule) => !!rule.oneOf).oneOf;
const babelRule = rules.find((rule) => /babel-loader/.test(rule.loader));
babelRule.options.plugins.push(require.resolve('babel-plugin-istanbul'));
}
`
But I noticed that component testing is not looking at the "nyc" prop in my package.json that says:
"nyc": { "all": true,
as it is not taking into account all files in code coverage %. Any idea how to get it to read package.json, as it is supposed to be the default for babel-plugin-istanbul?
Beta Was this translation helpful? Give feedback.
All reactions