forked from npm/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
config: Add option to turn off progress bars
PR-URL: npm/npm#9037 Fixes: npm/npm#8704
- Loading branch information
Showing
5 changed files
with
51 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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') | ||
}) | ||
}) |