test: do not require flags when executing a file by BridgeAR · Pull Request #26858 · nodejs/node (original) (raw)
Our javascript unit tests files are intended to be runnable standalone, because depency of tests on external runners introduces complexity and difficulty in debugging.
Usually they are runnable standalone, except sometimes they are only runnable with cooperation from a giant, undocumented, and difficult to understand glob of python (I say that as someone who has a half dozen times tried to figure out what some of its effectively undocumented command line arguments mean by reading the test.py source, unsucessfully). test.py seems to be the real black magic here.
I like this pure-node approach so much I'd be in favour of the dependency of our javascript tests on the python runner being stripped out, and this way of running the tests becoming the default.
As a developer friendly optimization, its great that the re-spawn of a child can be evaded when running with debuggers (gdb or inspector) by directly specifying the CLI options. This PR preserves that quality. 👍