Support code loader now works with windows #226
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi,
I found an issue when running cucumberjs under windows. It was not loading the support files before the step definitions. This was because the regexp in the support_code_loader.js file was hard coded to a 'normal' file path. Obviously, windows has to be different as always, so I have added a test for the windows platform and used backslashes in the regexp when this test passes.
I have since ran the unit tests which all pass
I could not think of a way to test this change in the unit test as I needed to spy on 'os.platform()' and return different values. This would have needed to have been done before the code was loaded.
I have also tested it using my test suite (which contains a good 200+ steps) and it works on both linux (which it always did) and windows (which didn't work previously).
This pull request as you can see contains the required change.
Hopefully you can include this in the next release and I can remove my fork from github.
Thanks
Gary