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: ensure absolute paths (as file urls) can be loaded for formatters, snippets #1963

Merged
merged 8 commits into from Mar 25, 2022

Conversation

davidjgoss
Copy link
Contributor

🤔 What's changed?

As part of the ESM support, we started loading formatters and snippet syntaxes with await import(). Unlike require(), paths you pass to import() have to be a valid URL, and for absolute paths that means using the file:// scheme.

This PR:

  • Adds a test to prove that classes can be successfully loaded based on a file:// URL
  • Fixes some code in the configuration module in order that file:// URLs are correctly accounted for when parsing the --format option (which unfortunately uses : as the delimiter)
  • Adds a note to the documentation on formatters.

This will also be called out in the migration guide via #1962

⚡️ What's your motivation?

Fixes #1920.

🏷️ What kind of change is this?

  • 🐛 Bug fix (non-breaking change which fixes a defect)

📋 Checklist:

  • I agree to respect and uphold the Cucumber Community Code of Conduct
  • I've changed the behaviour of the code
    • I have added/updated tests to cover my changes.
  • My change requires a change to the documentation.
    • I have updated the documentation accordingly.
  • Users should know about my change
    • I have added an entry to the "Unreleased" section of the CHANGELOG, linking to this pull request.

@coveralls
Copy link

coveralls commented Mar 24, 2022

Coverage Status

Coverage increased (+0.002%) to 98.218% when pulling a1cbd47 on fix/formatter-file-urls into aa3972a on main.

@davidjgoss davidjgoss merged commit 0acdfe0 into main Mar 25, 2022
@davidjgoss davidjgoss deleted the fix/formatter-file-urls branch March 25, 2022 09:00
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 this pull request may close these issues.

Windows path with the --format option works in v7, is broken in v8
3 participants