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:
The config file was read in twice, and printed two messages to that
effect.
Jasmine would only run a subprocess if you did want to modify the
environment, so in some situations your tests would be run in a sub-
process and in some situations they wouldn't.
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.
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:
The config file was read in twice, and printed two messages to that effect.
Jasmine would only run a subprocess if you did want to modify the environment, so in some situations your tests would be run in a sub- process and in some situations they wouldn't.
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.