tape-testing / tape

tap-producing test harness for node and browsers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

aral opened this issue · comments

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

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

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