avajs / ava

Node.js test runner that lets you develop with confidence 🚀
MIT License
20.74k stars 1.41k forks source link

Add registerCompletionHandler to main.d.cts #3307

Closed sosnovsky closed 8 months ago

sosnovsky commented 9 months ago

In 6.1.1 release it's not possible to use registerCompletionHandler in CommonJS project. This PR adds registerCompletionHandler to main.d.cts, so it can be imported in CommonJS

Fixes https://github.com/avajs/ava/issues/3306.

novemberborn commented 8 months ago

Thank you for the thorough PR @sosnovsky.

The lack of CJS here is intentional. Mostly to avoid polluting the default export, which is shared with ESM. Also because usage ought to be rare enough that you can work around it in CJS using dynamic import.

sosnovsky commented 8 months ago

Got it, thanks for explanation, will try to use it through dynamic import.