apache / cordova-fetch

Apache Cordova Fetch Library
https://cordova.apache.org/
Apache License 2.0
27 stars 27 forks source link

test: remove private internal method testing and rewire #110

Closed erisu closed 1 year ago

erisu commented 1 year ago

Platforms affected

n/a

Motivation and Context

Remove rewire which causes issues in Jasmine testing when files contains #!

The issue will appear when rebuilding package-lock.json or bumping @npmcli/arborist.

Since rewire has not been updated in a long time, it is better to remove.

Description

Removed the unit test file that focused on testing private internal methods. These methods are called and covered by calling the install and uninstall tests.

Only 1.56% is lost from coverage but the single line it covered was only if an argument existed on an array.

This could be easily restored by adding more install tests with the flag. Only downside is increased run time as it calls npm and git directly.

Testing

npm t

With the unit testing of the private inner methods.

21 specs, 0 failures
Finished in 55.745 seconds
----------|---------|----------|---------|---------|-------------------
File      | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
----------|---------|----------|---------|---------|-------------------
All files |   92.18 |    79.31 |      90 |   93.33 |
 index.js |   92.18 |    79.31 |      90 |   93.33 | 45,128,154,170
----------|---------|----------|---------|---------|-------------------

With out the unit testing of the private inner methods.

11 specs, 0 failures
Finished in 65.361 seconds
----------|---------|----------|---------|---------|-------------------
File      | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
----------|---------|----------|---------|---------|-------------------
All files |   90.62 |    72.41 |      90 |   91.66 |
 index.js |   90.62 |    72.41 |      90 |   91.66 | 45,98,128,154,170
----------|---------|----------|---------|---------|-------------------

Checklist

codecov-commenter commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 91.66%. Comparing base (23be9ed) to head (584f007). Report is 15 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #110 +/- ## ========================================== - Coverage 93.33% 91.66% -1.67% ========================================== Files 1 1 Lines 60 60 ========================================== - Hits 56 55 -1 - Misses 4 5 +1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.