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/view.js')
-rw-r--r--deps/npm/test/lib/view.js22
1 files changed, 8 insertions, 14 deletions
diff --git a/deps/npm/test/lib/view.js b/deps/npm/test/lib/view.js
index f3e5d97f333..9419ab7ec85 100644
--- a/deps/npm/test/lib/view.js
+++ b/deps/npm/test/lib/view.js
@@ -553,7 +553,7 @@ t.test('throws when unpublished', (t) => {
})
})
-t.test('completion', (t) => {
+t.test('completion', async t => {
const view = requireInject('../../lib/view.js', {
'../../lib/npm.js': {
flatOptions: {
@@ -565,17 +565,14 @@ t.test('completion', (t) => {
packument,
},
})
- view.completion({
+ const res = await view.completion({
conf: { argv: { remain: ['npm', 'view', 'green@1.0.0'] } },
- }, (err, res) => {
- if (err)
- throw err
- t.ok(res, 'returns back fields')
- t.end()
})
+ t.ok(res, 'returns back fields')
+ t.end()
})
-t.test('no registry completion', (t) => {
+t.test('no registry completion', async t => {
const view = requireInject('../../lib/view.js', {
'../../lib/npm.js': {
flatOptions: {
@@ -583,10 +580,7 @@ t.test('no registry completion', (t) => {
},
},
})
- view.completion({
- conf: { argv: { remain: ['npm', 'view'] } },
- }, (err) => {
- t.notOk(err, 'there is no package completion')
- t.end()
- })
+ const res = await view.completion({conf: { argv: { remain: ['npm', 'view'] } } })
+ t.notOk(res, 'there is no package completion')
+ t.end()
})