-
Notifications
You must be signed in to change notification settings - Fork 12k
chore(test): update project blueprint to karma-remap-istanbul ^0.3.0 for coverage excludes #4195
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
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
I signed it! |
CLAs look good, thanks! |
Heya @dpmorrow, thanks for taking the time to do this PR. It's well done and kudos for including the test case as well! If possible, I'd prefer to not add more options to To me it would be preferable to use it instead, if it covers your usecase. |
tests/e2e/utils/fs.ts
Outdated
@@ -138,6 +138,29 @@ export function expectFileToMatch(fileName: string, regEx: RegExp | string) { | |||
}); | |||
} | |||
|
|||
export function expectFileNotToMatch(fileName: string, regEx: RegExp | string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not expectToFail(() => expectToMatch(fileName, regEx))
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hansl I agree, I read some more tests while waiting for Travis and realized that was probably the right way to work with existing helpers.
@@ -61,6 +61,12 @@ | |||
"test": { | |||
"type": "string" | |||
}, | |||
"coverageExcludes": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you give me an example of code (outside of specs and node_modules) you want to exclude?
I think a smarter default to exclude everything outside of the appRoot as well would be better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For example, appRoot/testing/test.helper.ts. I understand as a workaround I could've used test.helper.spec.ts but that was too messy IMO.
I'm going to check out the karma-remap-istanbul 0.3.0 fix that @felipesilva suggested when I get home later. The only difference there being no glob support, but that could be implemented on the karma-remap-istanbul side if really necessary (and it probably isn't).
So at any rate I'll check out that solution and probably recommend closing this in favor of updating to ^0.3.0 karma-remap-istanbul and adding documentation to guide people to that solution.
If you have strong feelings one way or another let me know, otherwise thanks to both of you for the input!
I only wonder why I couldn't find @felipesilva's solution when I looked! Oh well, this was a good and fun learning experience regardless!
I confirmed that my use case is resolved by 0.3.0 karma remap. Now I don't think I've got the energy to complete the effort tonight, however this is what I'm thinking:
Does that seem about right? Would the test runner clean something up in the directory above app? I guess I could also delete the file after the expectation is done if not. Would you think this would need a call out in the readme anymore or just let the karma.conf.js that's generated do the explaining in conjunction with karma-remap-istanbul docs? |
I was thinking about it and realized that removing the exclude being sent to the instrumentation loader would be a breaking change for existing projects. That is to say they would need to port their project to using the karma-remap-istanbul exclude if I do the change as I suggested above. Will that be an issue? |
f2fdc6e
to
790dda6
Compare
I guess I messed up my rebase broke this PR. I decided to just update the dependency version and put a note in the readme pointing to the issue in karma-remap-istanbul. I will submit a new PR with just that and reference this one. Edit: just pushed new changes and reopened. |
The build failed due to linting but doesn't fail for me locally... Not sure what's wrong here but I'm going to rebase it again and see if it succeeds. |
39e5a99
to
ee5d7f5
Compare
…for coverage excludes Update the project blueprint to allow specifying additional coverage excludes via the karma- istanbul-remap excludes property that was added in 0.3.0.
ee5d7f5
to
917f2d9
Compare
@hansl simple blueprint/readme update ready to merge. |
I'm sorry for this, but we had to move away from remap-instanbul due to licensing concerns. You can see more about it in #4560. |
@filipesilva thanks for the heads up on this. I'll watch the progress on the new reporter and see if it's appropriate to do a new PR in the future when and if the maintainer adds the equivalent functionality back. Take care and keep up the great work! |
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. |
Implemented coverage excludes as an array of blobs and/or paths relative to the app root.
See README.md for documentation.
Fulfills #3356