diff options
Diffstat (limited to 'deps/npm/test/lib/set.js')
-rw-r--r-- | deps/npm/test/lib/set.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/deps/npm/test/lib/set.js b/deps/npm/test/lib/set.js index f51065a4b29..14d094001b4 100644 --- a/deps/npm/test/lib/set.js +++ b/deps/npm/test/lib/set.js @@ -1,5 +1,32 @@ const t = require('tap') +// can't run this until npm set can save to npm.localPrefix +t.skip('npm set', async t => { + const { real: mockNpm } = require('../fixtures/mock-npm') + const { joinedOutput, command, npm } = mockNpm(t) + await npm.load() + + t.test('no args', async t => { + t.rejects( + command('set'), + /Usage:/, + 'prints usage' + ) + }) + + t.test('test-config-item', async t => { + npm.localPrefix = t.testdir({}) + t.not(npm.config.get('test-config-item', 'project'), 'test config value', 'config is not already new value') + // This will write to ~/.npmrc! + // Don't unskip until we can write to project level + await command('set', ['test-config-item=test config value']) + t.equal(joinedOutput(), '', 'outputs nothing') + t.equal(npm.config.get('test-config-item', 'project'), 'test config value', 'config is set to new value') + }) +}) + +// Everything after this can go away once the above test is unskipped + let configArgs = null const npm = { commands: { |