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

Support --require of ESM; closes #4281 #4304

Merged
merged 7 commits into from Jun 1, 2020
Merged

Commits on May 27, 2020

  1. Support --require of ESM; closes mochajs#4281

    Allow files/modules specified in `--require` to be ESM.
    
    CommonJS loading is still supported and the default.
    JacobLey committed May 27, 2020
    Copy the full SHA
    5ef04be View commit details
    Browse the repository at this point in the history

Commits on May 28, 2020

  1. Conditionally generate url for import

    Windows compatible
    JacobLey committed May 28, 2020
    Copy the full SHA
    f28fd67 View commit details
    Browse the repository at this point in the history
  2. Add tests for --require ESM

    As both .mjs and type=module (combined with cjs for good measure).
    
    Updated linter to allow tests to use spread operator (ecmaVersion 2018)
    
    Allow --require'd module to be an object, or "module"
    JacobLey committed May 28, 2020
    Copy the full SHA
    e9834fd View commit details
    Browse the repository at this point in the history
  3. Copy the full SHA
    ebc2a07 View commit details
    Browse the repository at this point in the history
  4. Replace type() -> typeof

    Add truthy check to handle null edge case
    
    type(ES Module) => "module", but we treat it the same as an object
    JacobLey committed May 28, 2020
    Copy the full SHA
    c411c30 View commit details
    Browse the repository at this point in the history

Commits on May 29, 2020

  1. Copy the full SHA
    a6029b9 View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    cc401ce View commit details
    Browse the repository at this point in the history