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

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

Open
aral opened this issue Mar 21, 2022 · 1 comment

Comments

@aral
Copy link

aral commented Mar 21, 2022

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
Copy link
Collaborator

ljharb commented Mar 21, 2022

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

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

No branches or pull requests

2 participants