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

fix(mocha-runner): clear error when require esm #3015

Merged
merged 2 commits into from Jul 22, 2021
Merged

Conversation

nicojs
Copy link
Member

@nicojs nicojs commented Jul 21, 2021

Provide a clear error message when users configure mochaOptions.require to include "esm". You should provide it as a node argument instead.

{
  "$schema": "./node_modules/@stryker-mutator/core/schema/stryker-schema.json",
  "testRunner": "mocha",
  "mochaOptions": {
-   "require": ["esm"]
  },
+ "testRunnerNodeArgs": ["--require", "esm"]
}

Fixes #3014

@nicojs
Copy link
Member Author

nicojs commented Jul 21, 2021

The error message looks like this:

21:08:07 (27028) ERROR Stryker Unexpected error occurred while running Stryker Error: Error: Config option "mochaOptions.require" does not support "esm", please use "testRunnerNodeArgs": ["--require", "esm"] instead. See #3014 for more information.
Error: Config option "mochaOptions.require" does not support "esm", please use "testRunnerNodeArgs": ["--require", "esm"] instead. See #3014 for more information.

@nicojs nicojs merged commit a835f0b into master Jul 22, 2021
@nicojs nicojs deleted the fix/mocha-runner-esm branch July 22, 2021 15:09
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.

Mocha runner does not support require "esm"
1 participant