Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2020-08-07 00:13:30 +0300
committerisaacs <i@izs.me>2020-08-07 00:28:50 +0300
commitd062b2c02a4d6d5f1a274aa8eb9c5969ca6253db (patch)
treed9e1d7ff5fe77d21f93d37c50bb72bb03f4a7940 /test/lib/npm.js
parentcf2819210327952696346486002239f9fc184a3e (diff)
new npm-specific update-notifier implementation
This drops our usage of the update-notifier module, in favor of checking ourselves, using the modules and UX patterns that npm already has in place. - While on a prerelease version, updates are checked for every day, instead of every week, and always checks for a new beta in the current release family. Ie, ^7.0.0-beta.2 instead of latest. - Latest version is suggested if newer than current. - If current version is newer than latest, then we check again for an update in the current version family. Ie, ^7.0.0 instead of latest, if current is 7.0.0 and latest is 6.x. - Output is printed using log.notice, at the end of all other log output, so that it's both less visually disruptive, and less likely to be missed among other warnings and notices. This has the side effect of requiring that we set npm.flatOptions as soon as config is loaded, rather than waiting for a command to be run. Since the cli runs a command immediately after loading anyway, this is not a relevant change for our purposes, but worth mentioning here.
Diffstat (limited to 'test/lib/npm.js')
-rw-r--r--test/lib/npm.js3
1 files changed, 1 insertions, 2 deletions
diff --git a/test/lib/npm.js b/test/lib/npm.js
index e4e31e5d3..3c62643fc 100644
--- a/test/lib/npm.js
+++ b/test/lib/npm.js
@@ -115,8 +115,7 @@ t.test('npm.load', t => {
t.match(npm, {
loaded: true,
loading: false,
- // flatOptions only loaded when we run an actual command
- flatOptions: null
+ flatOptions: {}
})
t.equal(firstCalled, true, 'first callback got called')
t.equal(secondCalled, true, 'second callback got called')