Skip to content

Commit

Permalink
fix(tests): go back to mockNpm in test
Browse files Browse the repository at this point in the history
This was erroneously removed during a merge conflict
  • Loading branch information
wraithgar committed Mar 18, 2021
1 parent 7e99515 commit fc8a1ff
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions test/lib/help-search.js
@@ -1,18 +1,19 @@
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 = []
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: {
Expand All @@ -25,7 +26,7 @@ const npm = {
},
},
output,
}
})

let globRoot = null
const globDir = {
Expand Down Expand Up @@ -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
})

Expand All @@ -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
})
Expand Down

0 comments on commit fc8a1ff

Please sign in to comment.