Skip to content

Conversation

@brettz9
Copy link

@brettz9 brettz9 commented Nov 5, 2025

PR Checklist

Overview

Adds an ESM export file for use in the browser.

The other non-underscored (private) keys I saw on the global mocha object which I wasn't sure which I might include were the following:

files, options, suite, isWorker, throwError, ui

@mark-wiemer
Copy link
Member

For now let's exclude the private keys, they shouldn't be necessary for this export.

@mark-wiemer mark-wiemer self-assigned this Nov 8, 2025
@codecov
Copy link

codecov bot commented Nov 8, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.69%. Comparing base (fb0215b) to head (a97ece6).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5527   +/-   ##
=======================================
  Coverage   93.69%   93.69%           
=======================================
  Files          57       57           
  Lines        4390     4390           
  Branches      849      849           
=======================================
  Hits         4113     4113           
  Misses        277      277           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@brettz9
Copy link
Author

brettz9 commented Nov 8, 2025

Thank you for the review!

I saw the linting failed after the merge, so I added my addition of /mocha.mjs to the eslint config file. There's also still a failure with /esm/mocha.js, a file that predated this PR, but with that file not being published, I wasn't sure what that was about. It technically is not even allowed with the ".js" extension since the package.json is type: 'commonjs'. Don't know if that file should be converted to .mjs, removed, treated as ESM by the linter anyways, or what?

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

Successfully merging this pull request may close these issues.

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

2 participants