esm: misc test refactors
This PR contains miscellaneous test refactors that were done as part of #44710 but can live on their own. Specifically:
- Add a new test specific to the event loop
- Move
parallel/
tests intoes-module/
- Refactor
hooks-custom.mjs
fixture to put theresolve
hook first and add braces forif
blocks - Use
os
instead offs
as a dummy placeholder, since other loaders overridefs
as part of their tests - Spelling, line lengths
This PR also adds test/es-module/test-esm-loader-spawn-promisified.mjs
, which is a rewrite of test-esm-loader.mjs
to use the test runner and spawnPromisified
. Personally I like this version better, but if people prefer test-esm-loader.mjs
I can delete the new file; I don’t think we should keep both. The new test test-esm-loader-event-loop.mjs
covers a scenario that the old test-esm-loader.mjs
was inadvertently testing, of many rejected promises in the same file loaded through a custom loader.