Skip to content

Commit

Permalink
fixup! fix(doctor): allow for missing local bin and node_modules
Browse files Browse the repository at this point in the history
  • Loading branch information
lukekarrys committed Mar 8, 2022
1 parent b17e900 commit 3e81262
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions test/lib/commands/doctor.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
const t = require('tap')
const { load: loadMockNpm } = require('../../fixtures/mock-npm')
const tnock = require('../../fixtures/tnock.js')
const fs = require('fs')

const { load: loadMockNpm } = require('../../fixtures/mock-npm')
const tnock = require('../../fixtures/tnock.js')
const mockGlobals = require('../../fixtures/mock-globals')
const { cleanCwd, cleanDate } = require('../../fixtures/clean-snapshot.js')

const cleanCacheSha = (str) =>
Expand Down Expand Up @@ -67,12 +68,17 @@ const globals = {
version: 'v1.0.0',
},
}

// getuid and getgid do not exist in windows, so we shim them
// to return 0, as that is the value that lstat will assign the
// gid and uid properties for fs.Stats objects
if (process.platform === 'win32') {
globals.process.getuid = () => 0
globals.process.getgid = () => 0
mockGlobals(t, {
process: {
getuid: () => 0,
getgid: () => 0,
}
})
}

const mocks = {
Expand Down

0 comments on commit 3e81262

Please sign in to comment.