Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/test/lib/get.js')
-rw-r--r--deps/npm/test/lib/get.js26
1 files changed, 13 insertions, 13 deletions
diff --git a/deps/npm/test/lib/get.js b/deps/npm/test/lib/get.js
index 9b77fbba3e6..30e26b7453f 100644
--- a/deps/npm/test/lib/get.js
+++ b/deps/npm/test/lib/get.js
@@ -1,16 +1,16 @@
const t = require('tap')
+const { real: mockNpm } = require('../fixtures/mock-npm')
-t.test('should retrieve values from npm.commands.config', (t) => {
- const Get = t.mock('../../lib/get.js')
- const get = new Get({
- commands: {
- config: ([action, arg]) => {
- t.equal(action, 'get', 'should use config get action')
- t.equal(arg, 'foo', 'should use expected key')
- t.end()
- },
- },
- })
-
- get.exec(['foo'])
+t.test('should retrieve values from config', async t => {
+ const { joinedOutput, command, npm } = mockNpm(t)
+ const name = 'editor'
+ const value = 'vigor'
+ await npm.load()
+ npm.config.set(name, value)
+ await command('get', [name])
+ t.equal(
+ joinedOutput(),
+ value,
+ 'outputs config item'
+ )
})