Skip to content
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

Fix the javascript/windows build #2

Closed
mattwynne opened this issue Nov 20, 2022 · 2 comments · Fixed by #48
Closed

Fix the javascript/windows build #2

mattwynne opened this issue Nov 20, 2022 · 2 comments · Fixed by #48

Comments

@mattwynne
Copy link
Member

🤔 What's the problem you've observed?

Javascript tests fail on Windows

e.g. https://github.com/cucumber/gherkin-utils/actions/runs/3504533429/jobs/5870269520

✨ Do you have a proposal for making it better?

Figure it out and fix it.

📚 Any additional context?

Breaking this out of scope of #1


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

@jennek
Copy link

jennek commented Jan 14, 2023

The problem seems to be in javascript/test/messageTest.ts line 15

  const tckMessageFiles = fg.sync(
    `${__dirname}/../node_modules/@cucumber/compatibility-kit/features/**/*.ndjson`
  )

The files are definitely there, yet fg.sync returns an empty array. So something must be wrong with the glob pattern.

fastglob requires POSIX style patterns, in particular forward slashes. __dirname contains a Windows style path with backward slashes.
Replacing __dirname with __dirname.replace(/\\/g, '/') solved it for me. Using unixify would be the more elegant solution.

Source https://github.com/mrmlnc/fast-glob#how-to-write-patterns-on-windows

@jennek
Copy link

jennek commented Jan 14, 2023

there is a similar issue here
https://github.com/cucumber/gherkin-utils/blob/main/javascript/test/prettyTest.ts#:~:text=const%20featureFiles%20%3D%20fg.sync(%60%24%7B__dirname%7D/../../../gherkin/testdata/good/*.feature%60)

as no files are found by fg.sync, no tests are run. This does not break the build so it is easy to overlook.

Dbuggerx added a commit to Dbuggerx/gherkin-utils that referenced this issue Dec 19, 2023
mpkorstanje pushed a commit that referenced this issue Jan 4, 2024
* Cross-platform compatibility for GherkinDocumentWalker test paths. Fixes #2.
* Adjust GherkinDocumentWalker filtering of Rules. Fixes cucumber/react-components#136
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants