busterjs/buster-test-cli — pull request #15 by dymonaz (2014-10-22 07:41:14+00:00)
Title: allowing autoRun to be overridden properly

After some discussion on IRC, it seems that some configurability was lost - restoring just that.

Basically, at some point, the merging of `this.options` and `this.config.options` started happening at the wrong place - so I moved it to happen earlier - during `getClientRunConfig()` which gets called during `sessionStart()` - it should be safe, since that happens after `this.config.resolve()`. This allows `buster-amd` to function properly, as it sets `conf.options.autoRun`: https://github.com/busterjs/buster-amd/blob/master/lib/buster-amd.js#L32

The docs for `buster.js` file say: "Add { autoRun: false } to your config file and call buster.run() to start the test run. That gives you full control over when the test run starts." - this property gets exposed directly as `this.config.autoRun`, so if it is there - it's being used.

The final result is this:
* If `this.config.autoRun` (from `buster.js`) is set - use that
* Otherwise, if `this.config.options.autoRun` is set, it overrides whatever is set in `this.options.autoRun` and is used (`buster-amd` sets that)
* Otherwise use whatever is set in `this.options.autoRun` (Is this even possible? Is there anything that can set it there?)
* Otherwise use default value - `autoRun` is `true`