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:
authorRebecca Turner <me@re-becca.org>2015-07-23 10:06:05 +0300
committerRebecca Turner <me@re-becca.org>2015-07-25 05:45:19 +0300
commit423d8f7e8a291ecceab121b9d2ea207c809e17fd (patch)
tree012082a9640e7c15ec131ed27e15024651155989 /test
parent28ebc6c227c0347ac429ac01bbf01ce33f2eda5c (diff)
config: Add option to turn off progress bars
PR-URL: https://github.com/npm/npm/pull/9037 Fixes: https://github.com/npm/npm/issues/8704
Diffstat (limited to 'test')
-rw-r--r--test/tap/progress-config.js33
1 files changed, 33 insertions, 0 deletions
diff --git a/test/tap/progress-config.js b/test/tap/progress-config.js
new file mode 100644
index 000000000..ce6f4faa1
--- /dev/null
+++ b/test/tap/progress-config.js
@@ -0,0 +1,33 @@
+'use strict'
+var test = require('tap').test
+var log = require('npmlog')
+
+// We use requireInject to get a fresh copy of
+// the npm singleton each time we require it.
+// If we didn't, we'd have shared state between
+// these various tests.
+var requireInject = require('require-inject')
+
+test('disabled', function (t) {
+ t.plan(1)
+ var npm = requireInject('../../lib/npm.js', {})
+ npm.load({progress: false}, function () {
+ t.is(log.progressEnabled, false, 'should be disabled')
+ })
+})
+
+test('enabled', function (t) {
+ t.plan(1)
+ var npm = requireInject('../../lib/npm.js', {})
+ npm.load({progress: true}, function () {
+ t.is(log.progressEnabled, true, 'should be enabled')
+ })
+})
+
+test('default', function (t) {
+ t.plan(1)
+ var npm = requireInject('../../lib/npm.js', {})
+ npm.load({}, function () {
+ t.is(log.progressEnabled, true, 'should be enabled')
+ })
+})