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

🚀 Feature: Ability to import mocha from ESM in the browser #5211

Open
2 of 3 tasks
brettz9 opened this issue Sep 11, 2024 · 3 comments
Open
2 of 3 tasks

🚀 Feature: Ability to import mocha from ESM in the browser #5211

brettz9 opened this issue Sep 11, 2024 · 3 comments
Labels
area: browser browser-specific status: accepting prs Mocha can use your help with this one! type: feature enhancement proposal

Comments

@brettz9
Copy link

brettz9 commented Sep 11, 2024

Feature Request Checklist

Overview

Inability to import as ESM module from the browser

Suggested Solution

Include an ESM build

Alternatives

Use Rollup on the file but burdensome for each project. Continue adding separate script tags for Mocha and other projects.

Additional Info

No response

@brettz9 brettz9 added status: in triage a maintainer should (re-)triage (review) this issue type: feature enhancement proposal labels Sep 11, 2024
@JoshuaKGoldberg
Copy link
Member

JoshuaKGoldberg commented Sep 12, 2024

Inability to import as ESM module from the browser

Could you post a reproduction, please? Mocha does have both ESM and browser support, in theory. But both of those terms are pretty vague without more context.

🚀 Feature:

...and don't forget to fill out the title 🙂

@JoshuaKGoldberg JoshuaKGoldberg added status: waiting for author waiting on response from OP - more information needed and removed status: in triage a maintainer should (re-)triage (review) this issue labels Sep 12, 2024
@brettz9 brettz9 changed the title 🚀 Feature: <short description of the feature> 🚀 Feature: Ability to import mocha from ESM in the browser Sep 12, 2024
@brettz9
Copy link
Author

brettz9 commented Sep 12, 2024

Whoops... :-) Here. This doesn't work: https://github.com/brettz9/mocha-no-esm-minimal-test-repro

@JoshuaKGoldberg JoshuaKGoldberg added status: in triage a maintainer should (re-)triage (review) this issue and removed status: waiting for author waiting on response from OP - more information needed labels Sep 12, 2024
@JoshuaKGoldberg
Copy link
Member

👍 makes sense to me. I see no reason why we wouldn't want to enable a proper import for Mocha rather than relying on a global. Heck, I'd probably encourage users to use the import!

@JoshuaKGoldberg JoshuaKGoldberg added status: accepting prs Mocha can use your help with this one! area: browser browser-specific and removed status: in triage a maintainer should (re-)triage (review) this issue labels Oct 8, 2024
brettz9 added a commit to brettz9/mocha that referenced this issue Oct 8, 2024
brettz9 added a commit to brettz9/mocha that referenced this issue Oct 8, 2024
brettz9 added a commit to brettz9/mocha that referenced this issue Oct 8, 2024
brettz9 added a commit to brettz9/mocha that referenced this issue Oct 8, 2024
@brettz9 brettz9 mentioned this issue Oct 8, 2024
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: browser browser-specific status: accepting prs Mocha can use your help with this one! type: feature enhancement proposal
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants