Give karma.config.js access to command line arguments
See original GitHub issueCurrently, the config
argument passed into karma.config.js is an empty object, that gets filled out. It would be beneficial, to have access to command line arguments from within the configuration, through the passed config
object, as this would allow custom logic, based on those arguments to be applied.
Example scenario: There are two test suites (eg. unit and component) in two different folders. It’s desired to run only the selected test suite. This could easily be achieved by passing an argument on the command line (like suite=unit
), that karma.config.js would have access to and would set the proper value on the config.files
property.
What do people think about it? The implementation of this would be very straightforward (basically a one-liner).
Issue Analytics
- State:
- Created 8 years ago
- Comments:8 (5 by maintainers)
Top GitHub Comments
This would definitely be useful, such as for turning on/off coverage instrumentation via commandline when using non-standard processors like webpack.
Thanks @Dignifiedquire @danielcompton.
I figured out after posting that it’s mentioned in the OP (resolved config is under
config.*
).