ptomato / jasmine-gjs

Jasmine for GJS
MIT License
20 stars 8 forks source link

Launch a separate subprocess to run tests #31

Closed ptomato closed 4 years ago

ptomato commented 4 years ago

Since introducing the feature that makes it possible to use the config file to control the environment in which the tests are run, it has been necessary to run the actual tests in a subprocess. Previously, Jasmine would run itself as the subprocess. This was not so great, for several reasons:

This commit changes things so that the tests are always run in a subprocess. The "jasmine" script is a launcher that reads the config file and launches the subprocess, which is a "jasmine-runner" script in the package's libexec directory.

All the config-file parsing code now belongs to the launcher. The runner does not know about the config file; it is purely configured by the arguments the launcher passes on its command line. The options.js module is the only code loaded by both the launcher and the runner, because they both need to parse command line options.

In addition, the config.js module now doesn't import any other modules. The code has been made more testable in this and a few other ways.