cucumber / cucumber-js

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

Add support for ESM loaders #2399

Closed davidjgoss closed 5 months ago

davidjgoss commented 5 months ago

🤔 What's changed?

Adds a loader option to register loader hooks ahead of importing user code.

Updates documentation accordingly and also refreshes broader ESM documentation which was a little stale.

Also, makes the whole support block in the loadSupport and runCucumber API functions usable as a partial object - you can specify any/all of its props and it will default the rest. This is a pattern we should consider rolling out to the other blocks of the API options, otherwise we'll be making breaking changes whenever we add new props.

⚡️ What's your motivation?

Fixes #2364.

WIll provide a much better UX for folks doing TypeScript+ESM.

🏷️ What kind of change is this?

📋 Checklist:


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

coveralls commented 5 months ago

Coverage Status

coverage: 98.402% (+0.007%) from 98.395% when pulling 3f259feb11e942fd6474ee03aad2f0b718757936 on feat/loader-option into 8f96d9f8c7eb005e8f3a63f95762a81e8b526bec on main.