question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Give karma.config.js access to command line arguments

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
dtabuenccommented, Aug 20, 2015

This would definitely be useful, such as for turning on/off coverage instrumentation via commandline when using non-standard processors like webpack.

0reactions
JamieMasoncommented, Dec 8, 2015

Thanks @Dignifiedquire @danielcompton.

I figured out after posting that it’s mentioned in the OP (resolved config is under config.*).

Read more comments on GitHub >

github_iconTop Results From Across the Web

angularjs - karma start - passing parameters - Stack Overflow
If you use a default karma.conf.js created by karma init , you won't be able to pass arguments in this way by doing...
Read more >
Configuration File - Karma
The easiest way to generate an initial configuration file is by using the karma init command. This page lists all of the available...
Read more >
Karma Config - JavaScript Dev Tools
Karma Config eliminates the redundancy and boilerplate by applying sensible defaults so you only need to specify the one-off settings that are particular...
Read more >
62. Create Karma Configuration file, karma.config ... - YouTube
In this video we will see how to create the Karma configuration file, karma. config. js file for running the jasmine tests -...
Read more >
Run/Debug Configuration: Karma - PhpStorm - JetBrains
In this field, specify the command-line options that you want to pass to Karma to override the default settings from the karma.conf.js ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found