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.

v6 CLI arg verification breaks extra args parsing

See original GitHub issue

Hello, currently karma CLI doesn’t allow explicit test files as arg so we’re passing them at the end and parse them out in karma.conf.js and v6 breaks it so I’m essentially asking if:

  1. Karma CLI can support explicit test files passed in as args OR
  2. Make strict mode be optional

I understand that this is not previously a feature but a lot of stack overflow answers seem to point to this mechanism being the workaround to further modify karma conf using CLI arg.

The way we’re calling it is essentially karma start karma.conf.js [testFiles...]

Thanks!

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
devoto13commented, Jan 29, 2021

@paulie4 Thanks for sharing!

Looking at this library I start to think that maybe we should provide an API for a plugin to register their CLI arguments. This way there will be one standard mechanism and as a bonus, we can include parameters provided by plugins in the karma --help output. Which will be a neat feature.

The solution from https://github.com/karma-runner/karma/issues/3625#issuecomment-766438809 will not work for karma-jasmine-spec-tags without extra changes on their side. At this point, I lean towards temporarily reverting the strict parameters validation and gathering more feedback on the custom parameter use cases. So we can design a mechanism, which works for everybody.

2reactions
devoto13commented, Jan 24, 2021

So I think the best solution would be to introduce --client-args flag for karma run command, then add a warning that the behavior of karma run -- my-arg form is going to change and point to the new --client-args flag. Allow passing arbitrary arguments after -- on any karma command. If this sounds like a good plan, I’ll work on the PR in the coming days.

Read more comments on GitHub >

github_iconTop Results From Across the Web

argparse — Parser for command-line options, arguments and ...
For a more gentle introduction to Python command-line parsing, have a look at the argparse tutorial. The argparse module makes it easy to...
Read more >
Build Command-Line Interfaces With Python's argparse
The command-line argument parser is the most important part of any argparse CLI. All the arguments and options that you provide at the...
Read more >
Command-line API | Node.js v19.3.0 Documentation
Indicate the end of node options. Pass the rest of the arguments to the script. If no script filename or eval/print script is...
Read more >
Managing Service Instances with the cf CLI
Arbitrary parameters require cf CLI v6.12.1+. Some services support providing additional configuration parameters with the provision request.
Read more >
Command line argument parsing in Rust using Clap
Issues with the arguments and flags ... We can fix this by checking that the file_name is not empty on line 27 above,...
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