There is great post "Testing native ES modules using Mocha and esm" of Alex Gibson. Thanks him.
I've tried to use mocha with native ES modules support in my project and I had 2 different errors:
$ ./node_modules/mocha/bin/mocha --require esm './test/Util.test.js'
TypeError [ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING]: A dynamic import callback was not specified.
at exports.importModuleDynamicallyCallback (internal/process/esm_loader.js:41:9)
at formattedImport (/.../node_modules/mocha/lib/esm-utils.js:6:23)
at Object.exports.requireOrImport (/.../node_modules/mocha/lib/esm-utils.js:23:14)
at Object.exports.loadFilesAsync (/.../node_modules/mocha/lib/esm-utils.js:33:34)
at Mocha.loadFilesAsync (/.../node_modules/mocha/lib/mocha.js:427:19)
...
$ /usr/bin/node /.../node_modules/mocha/bin/mocha -r esm --ui bdd --reporter \
/.../PhpStorm/plugins/NodeJS/js/mocha-intellij/lib/mochaIntellijReporter.js \
/.../test/Util.test.js
TypeError: Invalid host defined options
at formattedImport (/.../node_modules/mocha/lib/esm-utils.js:6:23)
at Object.exports.requireOrImport (/.../node_modules/mocha/lib/esm-utils.js:23:14)
at Object.exports.loadFilesAsync (/.../node_modules/mocha/lib/esm-utils.js:33:34)
at Mocha.loadFilesAsync (/.../node_modules/mocha/lib/mocha.js:427:19)
...