v6 CLI arg verification breaks extra args parsing
See original GitHub issueHello, 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:
- Karma CLI can support explicit test files passed in as args OR
- 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:
- Created 3 years ago
- Reactions:1
- Comments:7 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@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.
So I think the best solution would be to introduce
--client-args
flag forkarma run
command, then add a warning that the behavior ofkarma 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.