Skip to content

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 into es-module/
  • Refactor hooks-custom.mjs fixture to put the resolve hook first and add braces for if blocks
  • Use os instead of fs as a dummy placeholder, since other loaders override fs 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.

Merge request reports

Loading