You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Checked next-gen ES issues and syntax problems by using the same environment and/or transpiler configuration without Mocha to ensure it isn't just a feature that actually isn't supported in the environment in question or a bug in your code.
'Smoke tested' the code to be tested by running it outside the real test suite to get a better sense of whether the problem is in the code under test, your usage of Mocha, or Mocha itself
Ensured that there is no discrepancy between the locally and globally installed versions of Mocha. You can find them with: node node_modules/.bin/mocha --version(Local) and mocha --version(Global). We recommend that you not install Mocha globally.
Description
When using esmmocha 6.2.0 gives the error Cannot find module esm, if I change nothing and run the same thing in mocha 6.1.4 everything works.
import cnf from 'cnf';
import 'chai/register-should';
import chai from 'chai';
import chaiHttp from 'chai-http';
import chaiSubset from 'chai-subset';
chai.use(chaiHttp);
chai.use(chaiSubset);
Expected behavior: [What you expect to happen]
Test run
Actual behavior: [What actually happens]
Output
> NODE_ENV=test mocha
mocha debug [spec..]
Run tests with Mocha
Rules & Behavior
--allow-uncaught Allow uncaught errors to propagate [boolean]
--async-only, -A Require all tests to use a callback (async) or
return a Promise [boolean]
--bail, -b Abort ("bail") after first test failure [boolean]
--check-leaks Check for global variable leaks [boolean]
--delay Delay initial execution of root suite [boolean]
--exit Force Mocha to quit after tests complete [boolean]
--forbid-only Fail if exclusive test(s) encountered [boolean]
--forbid-pending Fail if pending test(s) encountered [boolean]
--global, --globals List of allowed global variables [array]
--retries Retry failed tests this many times [number]
--slow, -s Specify "slow" test threshold (in milliseconds)
[string] [default: 75]
--timeout, -t, --timeouts Specify test timeout threshold (in milliseconds)
[string] [default: 2000]
--ui, -u Specify user interface [string] [default: "bdd"]
Reporting & Output
--color, -c, --colors Force-enable color output [boolean]
--diff Show diff on failure
[boolean] [default: true]
--full-trace Display full stack traces [boolean]
--growl, -G Enable Growl notifications [boolean]
--inline-diffs Display actual/expected differences
inline within each string [boolean]
--reporter, -R Specify reporter to use
[string] [default: "spec"]
--reporter-option, --reporter-options, Reporter-specific options
-O (<k=v,[k1=v1,..]>) [array]
Configuration
--config Path to config file [string] [default: (nearest rc file)]
--opts Path to `mocha.opts` [string] [default: "./test/mocha.opts"]
--package Path to package.json for config [string]
File Handling
--extension, --watch-extensions File extension(s) to load and/or watch
[array] [default: js]
--file Specify file(s) to be loaded prior to root
suite execution [array] [default: (none)]
--ignore, --exclude Ignore file(s) or glob pattern(s)
[array] [default: (none)]
--recursive Look for tests in subdirectories [boolean]
--require, -r Require module [array] [default: (none)]
--sort, -S Sort test files [boolean]
--watch, -w Watch files in the current working directory
for changes [boolean]
Test Filters
--fgrep, -f Only run tests containing this string [string]
--grep, -g Only run tests matching this string or regexp [string]
--invert, -i Inverts --grep and --fgrep matches [boolean]
Positional Arguments
spec One or more files, directories, or globs to test
[array] [default: ["test"]]
Other Options
--help, -h Show usage information & exit [boolean]
--version, -V Show version number & exit [boolean]
--interfaces List built-in user interfaces & exit [boolean]
--reporters List built-in reporters & exit [boolean]
✖ ERROR: Unexpected identifier
npm ERR! Test failed. See above for more details.
Reproduces how often:
100%
Versions
The output of mocha --version
ash: /usr/local/bin/mocha: No such file or directory
and node node_modules/.bin/mocha --version:
6.2.0
The output of node --version:
v10.16.3
Your operating system
name and version:
macOS Mojave, version 10.14.6
architecture (32 or 64-bit):
64
Your shell (e.g., bash, zsh, PowerShell, cmd):
standard OSX
Your browser and version (if running browser tests):
Any third-party Mocha-related modules (and their versions):
Prerequisites
faq
labelnode node_modules/.bin/mocha --version
(Local) andmocha --version
(Global). We recommend that you not install Mocha globally.Description
When using
esm
mocha 6.2.0 gives the errorCannot find module esm
, if I change nothing and run the same thing in mocha 6.1.4 everything works.Steps to Reproduce
.mocharc.js
test/common.js
Expected behavior: [What you expect to happen]
Test run
Actual behavior: [What actually happens]
Output
Reproduces how often:
100%
Versions
mocha --version
ash: /usr/local/bin/mocha: No such file or directory
and
node node_modules/.bin/mocha --version
:6.2.0
The output of
node --version
:v10.16.3
Your operating system
name and version:
macOS Mojave, version 10.14.6
architecture (32 or 64-bit):
64
Your shell (e.g., bash, zsh, PowerShell, cmd):
standard OSX
Your browser and version (if running browser tests):
Any third-party Mocha-related modules (and their versions):
"chai": "4.2.0",
"chai-http": "4.3.0",
"chai-subset": "1.6.0",
Any code transpiler (e.g., TypeScript, CoffeeScript, Babel) being used (and its version):
esm v3.2.25
Additional info:
If you globally install mocha ant try to run tests it gives the error
Cannot find module esm
The text was updated successfully, but these errors were encountered: