Please use mochajs/mocha for questions! This channel is for discussions related to maintaining Mocha.
require
-ing mocha to get at the functions)? I'm assuming not, because doing so makes it work so well with linters, TS, and others, without needing to change the configuration (which is the reason I'm doing it). In any case, given that it is documented, I believe we should fix the bug. And, yes, I agree that the best way to fix the bug is to change the test functions (e.g. it
, before
) to be static and not rely on the "PRE_REQUIRE" method. Are you sure doing that is a fundamental re-architecture-ing? Won't it just be a case of making the functions act on a "current" global mocha that is set whenever a new Mocha is instantiated?
require
/import
mocha, I would be onboard with a rethinking of how we handle this. for example, if you wanted to use the tdd
interface, you could import {test, suite} from ‘mocha/tdd’
. mocha
would always export it
, describe
, etc.
require/import
: what you proposed is exactly what I implemented in the PR. You can look at lib/entrypoints
: there is CJS and ESM for each one of the interfaces.
ERR_INVALID_ARG_TYPE
around workerpool
that we got in my PR (https://github.com/mochajs/mocha/runs/1822789163?check_suite_focus=true). Any chance we can publish a new Mocha version with this fix?
delete require.cache.foo
in cjs land? I'm very interested in this, but couldn't find anything last time I checked.