cucumber / cucumber-js

Cucumber for JavaScript
https://cucumber.io
MIT License
5.02k stars 1.09k forks source link

OptionSplitter - Doesn't work as expected on windows OS #2326

Closed tamil777selvan closed 10 months ago

tamil777selvan commented 11 months ago

👓 What did you see?

OptionSplitter is not working as expected in windows os.

✅ What did you expect to see?

When providing 'file:///c:/reporter.js' as input to the 'format' function, it splits the path into ['file:///c', '/reporter.js'], resulting in an error.

📦 Which tool/library version are you using?

🔬 How could we reproduce it?

Run cucumber JS by providing the custom formatter path created by the pathToFileURL method.

📚 Any additional context?

This is related to https://github.com/webdriverio/webdriverio/pull/11010#discussion_r1316999608


This text was originally generated from a template, then edited by hand. You can modify the template here.

davidjgoss commented 11 months ago

Hey @tamil777selvan. There is a change in the works to improve the parsing here.

But also, you should be able to wrap the value in an array and Cucumber will not attempt to split it. So like:

format: [ [ 'file:///c:/reporter.js' ] ] 

(It also supports a second item in the array to denote the target file, but from what I know of your use case that's not needed.)

tamil777selvan commented 10 months ago

Thank you, @davidjgoss. The solution provided above solved the issue. I will close this now.