-
Notifications
You must be signed in to change notification settings - Fork 12k
@angular/cli - eject command - testing does not output any coverage reports #5553
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
SOLVED! Here is what you have to do when you eject the config and get want to get code-coverage. Apologies if this is documented somewhere. Let me know if its not and I can document it. In your
The |
Thanks for your input @jgodi Setting up the 'codeCoverage' property actually does make the reporter work in a project where ng eject has been applied. But it only works if we still use the angular-cli in the list of karma frameworks. I need to use a different framework with the ejected webpack config. Essentially removing all relationships with angular-cli from the karma config. But still using the same webpack. There is definitely some config that I am missing in the webpack to make the reporter work. Anyone has some clues? |
Found out the extra configuration that was missing by going to the angular-cli source code: https://github.com/angular/angular-cli/blob/1cd0a0811df2b7a45cbffb413dd56e3ac21a96e4/packages/%40angular/cli/models/webpack-configs/test.ts Needed to add this configuration in the webpack to make code-coverage to work with zero dependency on angular-cli {
test: /\.(js|ts)$/,
loader: 'istanbul-instrumenter-loader',
enforce: 'post',
query: {
esModules: true
},
exclude: [
/\.(e2e|spec)\.ts$/,
/node_modules/
]
} |
@dreamerkumar any insight into where you added this in the webpack.config.js? |
@hikumealan it would be in the
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Bug Report or Feature Request (mark with an
x
)Versions
Repro steps.
The log given by the failure.
No failure, but there is no coverage numbers outputted.
Desired functionality.
A
coverage
folder is created and coverage reports populated.Mention any other details that might be useful.
The ejected
reporters
in thekarma.conf.js
are:I even updated these to
reporters: ['progress', 'coverage-istanbul', 'kjhtml']
and still have the same results (as per #5514).Has anyone else ran across this?
The text was updated successfully, but these errors were encountered: