Closed loynoir closed 2 years ago
$ git clone https://github.com/loynoir/reproduce-karmaMocha-237.mjs .
$ pnpm install
$ pnpm test
CJS
✔ bar
fastESM
✔ bar
SUMMARY:
✔ 2 tests completed
$ pnpm remove karma-mocha && pnpm install https://github.com/loynoir/karma-mocha && pnpm test
CJS
✔ bar
fastESM
✔ bar
slowESM
✔ bar
SUMMARY:
✔ 3 tests completed
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.
. If the bot doesn't comment, it means it doesn't think anything has changed.
ℹ️ Googlers: Go here for more info.
Changes
mocha.run
. If await failed, add a unit test, and throw error within.lib/adapter.js
from gitignore, so can use npm install <repo>
.mocha.requireHooks
now supported, load thru {type:"import", value:"/base/my/path/to/mochaHooks.mjs"}
mocha.requireHooks.beforeAll
works.mocha.requireHooks.afterAll
to verify mocha.run
run after all slow ESM modules.requireHooks
and type = 'module'
```txt Uncaught TypeError: this[opt] is not a function ``` Update mocha from 3.5.3 to 9.1.3, to support rootHooks ```txt Uncaught SyntaxError: Unexpected token 'export ``` Update karma from 1.7.1 to 6.3.6, to support files.type = 'module' ```txt WARN [karma-server]: Passing raw CLI options to `new Server(config, done)` is deprecated. Use `parseConfig(c onfigFilePath, cliOptions, {promiseConfig: true, throwErrors: true})` to prepare a processed `Config` instance and pass that as the `config` argument instead. ``` Update grunt-karma from 2.0.0 to 4.0.2, to get rid of warning.
README.md
updated for requireHooks
Fixme/todo:
import()
, reported SyntaxError by low version eslintimportSync()
and importSyncFallback()
when mocha accept serializable .requireHooks
, or accept import()
as .requireHooks
input.
Tested solved https://github.com/karma-runner/karma-mocha/issues/243