Code Monkey home page Code Monkey logo

Comments (6)

Xetoris avatar Xetoris commented on August 24, 2024 1

@Xetoris thanks for raising this super well explained issue.

What do you suggest as a solution to this? From what I see there are two options:

  1. use the windowsPathsNoEscape flag
  2. transform any path given to the glob function into a file path which enables compliant behavior between both OSes

What are your thoughts?

That's a good question.

I think both solution essentially accomplish the same ends -- you remove an backslashes (regardless if they are escaping special characters or not). This would break for people who might want to access a test file that has, say, a * in it.

We could maybe try and use a regex pattern to detect a backslashes not followed by a special case and swap them for forward slashes.

Another option I didn't look into is if there's any way to get a resolve() like functionality that we can specify the separator character with.

I can tinker around with it and see if I can come up with a solution that won't break the escape functionality of glob and still let Windows resolve correctly.

from webdriverio.

Xetoris avatar Xetoris commented on August 24, 2024

Please let me know if you need any more information. I think I found the issue and am happy to submit a PR to try and resolve it. Wanted to get a sanity check to make sure I'm not miss-interpreting or miss-using something and what solution would make the most sense.

from webdriverio.

christian-bromann avatar christian-bromann commented on August 24, 2024

@Xetoris thanks for raising this super well explained issue.

What do you suggest as a solution to this? From what I see there are two options:

  1. use the windowsPathsNoEscape flag
  2. transform any path given to the glob function into a file path which enables compliant behavior between both OSes

What are your thoughts?

from webdriverio.

wdio-bot avatar wdio-bot commented on August 24, 2024

Thanks for reporting!

We greatly appreciate any contributions that help resolve the bug. While we understand that active contributors have their own priorities, we kindly request your assistance if you rely on this bug being fixed. We encourage you to take a look at our contribution guidelines or join our friendly Discord development server, where you can ask any questions you may have. Thank you for your support, and cheers!

from webdriverio.

Xetoris avatar Xetoris commented on August 24, 2024

Writing in another thought so I don't forget it the next time I look at this.

According to the comment above the line where we adjust .spec to be a absolute path, it says it does that to make sure patterns are resolved from the CWD. The glob helper allows you to specify the root dir, which gets passed to the CWD of the globSync() method. Maybe we can remove the need to decide and defer to glob to make the smart decisions by just passing CWD as the root dir when we go to evaluate the .spec property?

from webdriverio.

christian-bromann avatar christian-bromann commented on August 24, 2024

Maybe we can remove the need to decide and defer to glob to make the smart decisions by just passing CWD as the root dir when we go to evaluate the .spec property?

I think that makes sense.

from webdriverio.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.