colinskow / angular-electron-dream-starter

:tada: An Angular Electron Starter kit featuring Webpack, Angular 4 (Router, Http, Forms, Services, ngrx, Tests, E2E, Coverage), Karma, Spectron, Jasmine, Istanbul, and TypeScript
MIT License
162 stars 54 forks source link

Modify karma.conf.js and webpack.test.js to remove coverage tools so … #12

Closed greg9504 closed 6 years ago

greg9504 commented 6 years ago

…that when tests cases are run in 'debug' mode they can be debugged. To debug run tests with watch:

npm run watch:test

Also added karma-webpack-grep so that specific tests can be targeted:

npm run watch:test:grep -- app/about/

runs and watches all .spec.ts files in directory about

npm run watch:test:grep -- app/about/about.component.spec.ts

runs and watches only tests in app/about/about.component.spec.ts

Add above information to readme.

bug fix, feature, doc update

Can not debug test cases. https://github.com/colinskow/angular-electron-dream-starter/issues/10

colinskow commented 6 years ago

@greg9504 thank you very much for this PR! Sorry for the slow response. Over the next few days I'm going to be preparing a new release of this package. There are a few minor corrections in your documentation. I'll merge after I'm able to take it for a test drive.

greg9504 commented 6 years ago

No problem. Let me know if there is anything else you need from me.

colinskow commented 6 years ago

@greg9504 how can we implement this so that coverage reports can also be generated when debugging is not needed?

greg9504 commented 6 years ago

@colinskow is that not happening now? The modifications should run the exact same karma config as before when you do not wish to debug the test, so running the command:

npm run test

will result in the coverage tools being run.

When I run that I see a coverage summary and I get a coverage directory.
image

Unfortunately I'm not that familiar with the coverage tools. If you can tell me what is missing I can see what I missed.

colinskow commented 6 years ago

@greg9504 sorry I hadn't checked your code. I just saw "remove coverage tools" in the title so it had me worried. I'd like to merge. Can you please fix the documentation issues pointed out above?

greg9504 commented 6 years ago

@colinskow I'm not sure of the issues as you only mentioned that you found something but didn't say what it was. I did add an image file, for it to be view-able you would need to upload it to the https://rawgit.com/colinskow/angular2-webpack-starter/electron/docs/img/debug_unittest.png

colinskow commented 6 years ago

@greg9504 see the two review comments above.

greg9504 commented 6 years ago

@colinskow Sorry I'm not seeing any link to comments. There is nothing under Reviewers at the top right and I don't see any other comments.

colinskow commented 6 years ago

I apologize... Apparently you can't see it until I click "submit review."

greg9504 commented 6 years ago

OK I've applied the requested changes.

colinskow commented 6 years ago

Thank you very much @greg9504 merged.