diff options
author | Gar <gar+gh@danger.computer> | 2021-03-18 23:53:35 +0300 |
---|---|---|
committer | Gar <gar+gh@danger.computer> | 2021-03-18 23:56:40 +0300 |
commit | fc8a1ff5c185b280403f5e65726aa9135490ca94 (patch) | |
tree | 81cf4707bde077ec2a0db9dd2a04a3db01478494 /test | |
parent | 7e9951551609c4049542d99cf0e1e8782f98bf31 (diff) |
fix(tests): go back to mockNpm in test
This was erroneously removed during a merge conflict
Diffstat (limited to 'test')
-rw-r--r-- | test/lib/help-search.js | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/test/lib/help-search.js b/test/lib/help-search.js index f046ba3d2..567097a2e 100644 --- a/test/lib/help-search.js +++ b/test/lib/help-search.js @@ -1,6 +1,7 @@ const { test } = require('tap') const { join } = require('path') const requireInject = require('require-inject') +const mockNpm = require('../fixtures/mock-npm') const ansicolors = require('ansicolors') const OUTPUT = [] @@ -8,11 +9,11 @@ const output = (msg) => { OUTPUT.push(msg) } -const config = new Map(Object.entries({ +const config = { long: false, -})) +} const npmHelpErr = null -const npm = { +const npm = mockNpm({ color: false, config, flatOptions: { @@ -25,7 +26,7 @@ const npm = { }, }, output, -} +}) let globRoot = null const globDir = { @@ -82,10 +83,10 @@ test('npm help-search multiple terms', t => { test('npm help-search long output', t => { globRoot = t.testdir(globDir) - config.set('long', true) + config.long = true t.teardown(() => { OUTPUT.length = 0 - config.set('long', false) + config.long = false globRoot = null }) @@ -100,11 +101,11 @@ test('npm help-search long output', t => { test('npm help-search long output with color', t => { globRoot = t.testdir(globDir) - config.set('long', true) + config.long = true npm.color = true t.teardown(() => { OUTPUT.length = 0 - config.set('long', false) + config.long = false npm.color = false globRoot = null }) |