-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
pickle_filter: use absolute paths #962
Conversation
src/pickle_filter.js
Outdated
@@ -47,7 +48,7 @@ export default class PickleFilter { | |||
} | |||
|
|||
matchesAnyLine({ pickle, uri }) { | |||
const lines = this.featureUriToLinesMapping[uri] | |||
const lines = this.featureUriToLinesMapping[path.resolve(uri || '')] |
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.
Does a test fail if the || ''
is removed? I don't understand why that is needed
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.
resolve
requires a string argument, could rewrite as:
const lines = this.featureUriToLinesMapping[uri ? path.resolve(uri) : undefined]
or just return true if uri is undefined, which is the case when running with a line that does not exist
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.
I can't think of a case where this function would be called without a uri
though.
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.
uri
is undefined
during all of the line, name, and tag filters
tests
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.
Auhh. Can you please update the unit tests so a uri is always passed in? I'd prefer not to have the || ''
since in real use I expect the uri to always be there
tests were setting this.input.uri = this.scenarioPath where |
Hi @mmuller99, Thanks for your making your first contribution to Cucumber, and welcome to the Cucumber committers team! You can now push directly to this repo and all other repos under the cucumber organization! 🍾 In return for this generous offer we hope you will:
On behalf of the Cucumber core team, |
Thanks! I'll release this later today |
@charlierudolph, @aslakhellesoy thanks |
Thanks guys for getting this fix! |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
resolves #924