apache / cordova-fetch

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

fix: do not pack rejections from resolve in array #88

Closed raphinesse closed 4 years ago

raphinesse commented 4 years ago

Motivation and Context

We use the package resolve to find out if a requested dependency is already installed. That package exports a callback based async API that we promisify using pify. Since the callback of resolve is called with multiple result arguments, we need to use the multiArgs option of pify here. Unfortunately that also wraps the errors of resolve into an array.

Description

This PR unwraps the errors returned by our promisified resolve.

Testing

Manual

codecov-io commented 4 years ago

Codecov Report

Merging #88 into master will increase coverage by 0.12%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #88      +/-   ##
==========================================
+ Coverage   92.18%   92.30%   +0.12%     
==========================================
  Files           1        1              
  Lines          64       65       +1     
==========================================
+ Hits           59       60       +1     
  Misses          5        5              
Impacted Files Coverage Δ
index.js 92.30% <100.00%> (+0.12%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update c19f888...57bdd23. Read the comment docs.