我正在尝试使用以下命令在ES6模块上使用mocha进行单元测试:
node --experimental-modules .\node_modules\mocha\bin\mocha --reporter progress "client/assets/utils/url-utils.test.mjs"
但是我遇到了以下错误:
(function (exports, require, module, __filename, __dirname) { export class URLUtils {
^^^^^^
SyntaxError: Unexpected token export
使用--experimental-modules
参数不应该让我使用ES6模块吗?我更喜欢避免使用Babel或其他转换器。
Node版本:11.7.0
Mocha版本:5.2.0