From fc8a1ff5c185b280403f5e65726aa9135490ca94 Mon Sep 17 00:00:00 2001 From: Gar Date: Thu, 18 Mar 2021 13:53:35 -0700 Subject: [PATCH] fix(tests): go back to mockNpm in test This was erroneously removed during a merge conflict --- test/lib/help-search.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/test/lib/help-search.js b/test/lib/help-search.js index f046ba3d2db63..567097a2eb183 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 })