diff options
author | isaacs <i@izs.me> | 2019-11-15 22:28:19 +0300 |
---|---|---|
committer | claudiahdz <cghr1990@gmail.com> | 2019-11-18 16:02:30 +0300 |
commit | 3ef295f23ee1b2300abf13ec19e935c47a455179 (patch) | |
tree | 88a6708e871fbbe6dc47ab80ae6bc91606e6037f /lib/install.js | |
parent | b150eaeff428180bfa03be53fd741d5625897758 (diff) |
fix: print quick audit report for human output
This was broken when the support/funding functionality changed the
return value to no longer track the promise for the quick audit
printing.
It was not caught by tests, because they were only running against the
--json output, and not verifying the quick audit results in any way.
Added a test to track the --json quick audit results (which were not
broken, but someday could become so) and the human printed quick audit
results (which were broken).
Paired with @ruyadorno @mikemimik
PR-URL: https://github.com/npm/cli/pull/486
Credit: @isaacs
Close: #486
Reviewed-by: @claudiahdz
Diffstat (limited to 'lib/install.js')
-rw-r--r-- | lib/install.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/install.js b/lib/install.js index 528a3a0b5..378ada7b0 100644 --- a/lib/install.js +++ b/lib/install.js @@ -878,9 +878,6 @@ Installer.prototype.printInstalledForHuman = function (diffs, auditResult) { report += ' in ' + ((Date.now() - this.started) / 1000) + 's' output(report) - if (auditResult) { - audit.printInstallReport(auditResult) - } function packages (num) { return num + ' package' + (num > 1 ? 's' : '') @@ -911,6 +908,10 @@ Installer.prototype.printInstalledForHuman = function (diffs, auditResult) { if (printFundingReport.length) { output(printFundingReport) } + + if (auditResult) { + return audit.printInstallReport(auditResult) + } } Installer.prototype.printInstalledForJSON = function (diffs, auditResult) { |