esm: rewrite loader hooks test
This is a spinoff from #44710. As part of that work, I needed to rewrite this test to no longer depend on internals and invoke ESMLoader
directly; instead it spawns a node
child process like most of the other loaders tests. The same result is confirmed, and this version of the test is less coupled to internal implementation details. I’m opening this as a standalone PR to confirm that this test passes for pre-refactor loaders code too, and to reduce the diff in the off-thread PR.
@nodejs/loaders @nodejs/modules @nodejs/testing