tape-testing / tape

tap-producing test harness for node and browsers
MIT License
5.77k stars 307 forks source link

Enhancement request: ESM version for testing apps that use custom ES Module Loaders #573

Closed aral closed 2 months ago

aral commented 2 years ago

Note: ES Module Loaders are experimental so I realise that per tape’s conservative approach this issue will not be considered until they are not (which is perfectly fine, I just want to document the use case so it might eventually be considered).

Summary

Since tape is CJS, you cannot run your tests using a custom ES Module Loader if your app uses one.

An ESM version of tape would allow you to.

Workaround

I’ve just released version 2.0.0 of @small-tech/esm-tape-runner that allows you to run your tests using your custom ES Module Loader.

See: https://github.com/small-tech/esm-tape-runner#advanced-usage-with-custom-es-module-loaders

ljharb commented 2 years ago

ESM can import CJS, so I’m not sure why any changes are needed. Can you help me understand?

ljharb commented 2 months ago

I'm pretty sure this is already possible, so, closing until there's an action item for tape.