Launch a separate subprocess to run tests #31
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.