glob
glob copied to clipboard
Failing to find files on MemoryFileSystem (Windows) when running on Linux machine
I was running unit tests which are including Glob(...).matches(...)
, and it fails to match files when the mock filesystem is Windows-style, and the actual machine OS is POSIX-style. Even passing fileSystem.path
as the context to Glob(...)
does not help. When I had a closer look I found that in case of **\*a*
, the class constructor appends {,/**}
to the pattern. And although this should not produce any harm, I believe, it is not working as expected. I suspect, the machine's directory separator is used instead of the one for the file system. The similar issue happens to Glob(...).listFileStsemSync(...)
.
I'm also encountering this issue.