Skip to content

Give karma.config.js access to command line arguments #1561

@danielsiwiec

Description

@danielsiwiec

Currently, 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).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions