-
Notifications
You must be signed in to change notification settings - Fork 9
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
feat(apiPath): add support for arrays and/or regexp when matching #29
Conversation
The build-failure seems be because of SauceLabs credentials not working. It got fixed now in #36 so you can update your fork (see instructions). Then try a Btw, a tip for future PR's is to create a new branch on your fork so it's easier for you to keep things updated. |
@@ -24,7 +24,8 @@ module.exports = function(config) { | |||
// source files, that you wanna generate coverage for | |||
// do not include tests or libraries | |||
// (these files will be instrumented by Istanbul) | |||
'app/scripts/**/*.js': sourcePreprocessors | |||
'app/scripts/**/*.js': sourcePreprocessors, | |||
'test/spec/**/*.js': sourcePreprocessors |
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.
As you can see on line 25 the comment says not to add the test files. It messes with the test coverage data.
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.
Sorry I didn't pay attention to the comments.
It is an long discussion to include unit tests in coverage or not.
I prefer to include them as they ensure that all lines of test code are executed, I mean, would be possible to get some line of expected assertion never been called and without coverage you never will be able to find out and the will never be evaluated.
Regarding messing values, while it would be true I managed to get a 100% test case coverage which should not affect too much on library values apart from more lines counted for percentage.
I would let them in but let me know what you think and will follow...
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.
Hmm interesting point. It would be really bad to have test code that never runs. Opinions aside, that comment is copied from Karma's Istanbul notes and I can't see test inclusion mentioned in Istanbul's notes on ignoring code that you mention in another comment. It also went to 100% even though Coveralls shows untested lines. So I'm skeptical at the moment =) Either way, that should be a separate PR as it's not related to new functionality.
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.
Regarding ignore directives they are for difficult code paths on the tested code, not tests code necessary, that is the reason you don't see mentions in Istanbul, both practices are related to coverage in any platform and technology.
Tried and can't find where I read about, will give it another try and let you know...
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.
Yes you could read it like that, but since it mostly talks about hard tested code and no example showed test code... well =)
It's so awesome of you to help! It would be great if you could add documentation to the readme on how to use the feature. |
Almost done, just need to add documentation on readme and separate test case each as you stated, will let you know when finished tomorrow to be reviewed and merged |
All improvements done. I reverted the dist files update buy not sure how to rewrite git history to remove the wrong commit. |
Thanks @Wolfium ! There's a nice answer on StackOverflow that you can follow to squash this into one commit. Check the "Optional - Cleaning commit history" section of the answer. You shouldn't need the I'm available on Gitter if you want to chat with me while you try it. |
@@ -206,7 +206,33 @@ angular.module('apiMock', []) | |||
} | |||
|
|||
function isApiPath(url) { | |||
return url.indexOf(config.apiPath) === 0; | |||
return (apiPathMatched(url, config.apiPath) !== undefined); |
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.
Indentation please =P
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.
Didn't see it.. 👍
Great work so far @Wolfium ! If you could squash your commit I'd be happy to merge it =) |
I didn't forget but not to much time for the squash, will back to this as soon as possible. |
It includes documentation updated and tests for added feature Fix #16
Hi @seriema, it took me a while to get a single commit, but I learn a lot about git. 👍 I hope now it is OK to be merged, I would like to use the new version from official repo. Regards |
feat(apiPath): add support for arrays and/or regexp when matching
Just from the starting comment about multiple routes this would be related to #28 |
Yepp, I noted that at the bottom of 28 and you can see the reference comment autogenerated by github. |
👍 |
|
Great, today will update to new version...!!! On Mon, Oct 5, 2015 at 4:33 PM John-Philip Johansson <
Saludos. |
It include tests for added feature
Fix #16