diff options
author | Rebecca Turner <me@re-becca.org> | 2017-02-14 04:11:03 +0300 |
---|---|---|
committer | Rebecca Turner <me@re-becca.org> | 2017-02-24 02:56:12 +0300 |
commit | 426b1805904a13bdc5c0dd504105ba037270cbee (patch) | |
tree | ff0c529100c913fd868acd49997f5a475e7d240f /test | |
parent | f4c3f489aa5787cf0d60e8436be2190e4b0d0ff7 (diff) |
metrics: Default reporting metrics to default registry
Previously it defaulted to the global registry, now it will
default to whatever your default registry is.
Credit: @iarna
PR-URL: https://github.com/npm/npm/pull/15757
Diffstat (limited to 'test')
-rw-r--r-- | test/common-tap.js | 6 | ||||
-rw-r--r-- | test/tap/anon-cli-metrics.js | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/test/common-tap.js b/test/common-tap.js index f96f54ebf..3a9f9d4d2 100644 --- a/test/common-tap.js +++ b/test/common-tap.js @@ -29,8 +29,6 @@ process.env.npm_config_legacy_bundling = 'false' process.env.random_env_var = 'foo' // suppress warnings about using a prerelease version of node process.env.npm_config_node_version = process.version.replace(/-.*$/, '') -// disable metrics for the test suite even if the user has enabled them -process.env.npm_config_send_metrics = 'false' var bin = exports.bin = require.resolve('../bin/npm-cli.js') @@ -49,6 +47,10 @@ exports.npm = function (cmd, opts, cb) { if (!opts.env.npm_config_cache) { opts.env.npm_config_cache = npm_config_cache } + if (!opts.env.npm_config_send_metrics) { + opts.env.npm_config_send_metrics = 'false' + } + nodeBin = opts.nodeExecPath || nodeBin var stdout = '' diff --git a/test/tap/anon-cli-metrics.js b/test/tap/anon-cli-metrics.js index cfabed7c8..995b10c02 100644 --- a/test/tap/anon-cli-metrics.js +++ b/test/tap/anon-cli-metrics.js @@ -23,7 +23,7 @@ var conf = { npm_config_tmp: tmpdir, npm_config_prefix: globaldir, npm_config_registry: common.registry, - npm_config_metrics_registry: common.registry, + npm_config_metrics_registry: null, npm_config_loglevel: 'warn' }) } |