bcoe / bcoe/c8

Cannot add flags after the script

Open
#540 3 comments 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
2.1k
Forks
99
PR merge metrics
No merged PRs in 30d

Description

* **Version**: `v22.4.0`
* **Platform**: `Linux M720q 6.5.0-35-generic #35~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue May 7 09:00:52 UTC 2 x86_64 x86_64 x86_64 GNU/Linux`

I am executing c8 like so;
```
c8 --src=src/ npm run test
```
Where `npm run test` is a custom defined npm command with its own parameters.

Sometimes I need to generate a report, so I do
```
c8 --src=src/ --reports-dir=coverage/ --reporter=text --reporter=lcov npm run test
```
All good.

Looking at help, it appears that c8 allows additional parameters after the `script`
```
$ npx c8 --help
c8 [opts] [script] [opts]
```
I tried to execute flags like so, but the flags after the `npm run test` script are ignored
```
c8 --src=src/ npm run test --reports-dir=coverage/ --reporter=text --reporter=lcov
```
How can I add the flags after the `npm run test` script?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.