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
path: root/test
diff options
context:
space:
mode:
authornlf <quitlahok@gmail.com>2020-12-18 20:15:15 +0300
committerisaacs <i@izs.me>2020-12-18 23:05:54 +0300
commit7539504e3abdec28039a7798e5ccb745b536cb6e (patch)
treed402304e8eaebc5521194cf927c07912178661fe /test
parent0ad958fe1cb811699caca235f361c8328baac8c4 (diff)
remove the metrics sendernlf/remove-metrics
PR-URL: https://github.com/npm/cli/pull/2382 Credit: @nlf Close: #2382 Reviewed-by: @isaacs
Diffstat (limited to 'test')
-rw-r--r--test/lib/npm.js7
-rw-r--r--test/lib/utils/error-handler.js5
-rw-r--r--test/lib/utils/flat-options.js5
3 files changed, 0 insertions, 17 deletions
diff --git a/test/lib/npm.js b/test/lib/npm.js
index dac9696ca..8494af6bb 100644
--- a/test/lib/npm.js
+++ b/test/lib/npm.js
@@ -202,8 +202,6 @@ t.test('npm.load', t => {
t.equal(npm.bin, npm.globalBin, 'bin is global bin after prefix setter')
t.notEqual(npm.bin, npm.localBin, 'bin is not local bin after prefix setter')
- t.equal(npm.config.get('metrics-registry'), npm.config.get('registry'))
-
beWindows()
t.equal(npm.bin, npm.globalBin, 'bin is global bin in windows mode')
t.equal(npm.dir, npm.globalDir, 'dir is global dir in windows mode')
@@ -261,7 +259,6 @@ t.test('npm.load', t => {
process.argv = [
node,
process.argv[1],
- '--metrics-registry', 'http://example.com',
'--prefix', dir,
'--userconfig', `${dir}/.npmrc`,
'--usage',
@@ -292,7 +289,6 @@ t.test('npm.load', t => {
throw er
t.equal(npm.config.get('scope'), '@foo', 'added the @ sign to scope')
- t.equal(npm.config.get('metrics-registry'), 'http://example.com')
t.match(logs.filter(l => l[0] !== 'timing' || !/^config:/.test(l[1])), [
[
'verbose',
@@ -396,7 +392,6 @@ t.test('set process.title', t => {
argv: [
process.execPath,
process.argv[1],
- '--metrics-registry', 'http://example.com',
'--usage',
'--scope=foo',
'ls',
@@ -415,7 +410,6 @@ t.test('set process.title', t => {
argv: [
process.execPath,
process.argv[1],
- '--metrics-registry', 'http://example.com',
'--usage',
'--scope=foo',
'token',
@@ -436,7 +430,6 @@ t.test('set process.title', t => {
argv: [
process.execPath,
process.argv[1],
- '--metrics-registry', 'http://example.com',
'--usage',
'--scope=foo',
'token',
diff --git a/test/lib/utils/error-handler.js b/test/lib/utils/error-handler.js
index 2dc116a4d..0b896fee4 100644
--- a/test/lib/utils/error-handler.js
+++ b/test/lib/utils/error-handler.js
@@ -78,10 +78,6 @@ const npmlog = {
},
}
-const metrics = {
- stop: () => null,
-}
-
// overrides OS type/release for cross platform snapshots
const os = require('os')
os.type = () => 'Foo'
@@ -124,7 +120,6 @@ const mocks = {
summary: [['ERR', err.message]],
detail: [['ERR', err.message]],
}),
- '../../../lib/utils/metrics.js': metrics,
'../../../lib/utils/cache-file.js': cacheFile,
}
diff --git a/test/lib/utils/flat-options.js b/test/lib/utils/flat-options.js
index ee7620fa7..6f580fabc 100644
--- a/test/lib/utils/flat-options.js
+++ b/test/lib/utils/flat-options.js
@@ -34,8 +34,6 @@ class MockConfig {
cache: 'cache',
'node-version': '1.2.3',
global: 'global',
- 'metrics-registry': 'metrics-registry',
- 'send-metrics': 'send-metrics',
registry: 'registry',
access: 'access',
'always-auth': 'always-auth',
@@ -299,15 +297,12 @@ t.test('various default values and falsey fallbacks', t => {
const npm = new Mocknpm({
'script-shell': false,
registry: 'http://example.com',
- 'metrics-registry': null,
searchlimit: 0,
'save-exact': false,
'save-prefix': '>=',
})
const opts = flatOptions(npm)
t.equal(opts.scriptShell, undefined, 'scriptShell is undefined if falsey')
- t.equal(opts.metricsRegistry, 'http://example.com',
- 'metricsRegistry defaults to registry')
t.equal(opts.search.limit, 20, 'searchLimit defaults to 20')
t.equal(opts.savePrefix, '>=', 'save-prefix respected if no save-exact')
t.equal(opts.scope, '', 'scope defaults to empty string')