This is likely because you were using
tests.mjs as an entry point for Mocha. I caught an oversight which let side loaded cases such as Mocha loading
require which shouldn’t be allowed. To avoid this you can use the
.js extension or rename your
tests-main.mjs and make your entry
tests.js that loads
tests-main.mjs with dynamic import,
import("./tests-main.mjs"). Let me know how it works out by dropping by the issue tracker.