pkgjs / parseargs

Polyfill of `util.parseArgs()`
Apache License 2.0
121 stars 9 forks source link

chore: add script to check coverage likely in upstream tests #134

Closed shadowspawn closed 1 year ago

shadowspawn commented 2 years ago

Add run-script to give coverage of index.js when run test/index.js, similar to coverage in upstream.

We have 100% coverage in this repo (175 tests), but have only copied up the 72 end-to-end tests in test/index.js.

See: #133

$ npm run coverup
> @pkgjs/parseargs@0.9.0 coverup
> c8 --check-coverage --include index.js tape 'test/index.js'

TAP version 13
# when short option used as flag then stored as flag
ok 1 should be deeply equivalent
...
----------|---------|----------|---------|---------|-------------------------
File      | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s       
----------|---------|----------|---------|---------|-------------------------
All files |   94.94 |    95.65 |     100 |   94.94 |                         
 index.js |   94.94 |    95.65 |     100 |   94.94 | 126-127,238-242,249-256 
----------|---------|----------|---------|---------|-------------------------
ERROR: Coverage for lines (94.94%) does not meet global threshold (95%)
ERROR: Coverage for statements (94.94%) does not meet global threshold (95%)
shadowspawn commented 1 year ago

If/when there is interest in the unit test coverage, I am still interested in improving it upstream.