hunk.code_window:       path-exists: 4.0.0
         path-name: 1.0.0
         ramda: 0.26.1
         read-yaml-file: 1.1.0
         remove-all-except-outer-links: 2.0.1
         resolve-link-target: 1.0.1
         rimraf: 3.0.0
         run-groups: 2.0.1
  
hunk.labels: keep keep keep keep replace keep keep keep
hunk.file_path: pnpm-lock.yaml
hunk.type: replace
file: import test = require('tape')
  import findBestGlobalPrefixOnWindows from '../src/findBestGlobalPrefixOnWindows'
  
  test('findBestGlobalPrefixOnWindows()', t => {
    if (process.platform !== 'win32') {
      t.comment('skipping on non-windows')
      t.end()
      return
    }
  
    const env = {
      APPDATA: 'C:\\Users\\Imre\\AppData\\Roaming',
      LOCALAPPDATA: 'C:\\Users\\Imre\\AppData\\Local',
    }
  
    t.equal(
      findBestGlobalPrefixOnWindows('C:\\Users\\Imre\\AppData\\Local\\nvs\\default', env),
      'C:\\Users\\Imre\\AppData\\Local\\nvs\\default',
      'keep npm global prefix if is inside AppData\\Local',
    )
  
    t.equal(
      findBestGlobalPrefixOnWindows('C:\\Users\\Imre\\AppData\\Roaming\\nvs\\default', env),
      'C:\\Users\\Imre\\AppData\\Roaming\\nvs\\default',
      'keep npm global prefix if is inside AppData\\Roaming',
    )
  
    t.equal(
      findBestGlobalPrefixOnWindows('C:\\foo', env),
      'C:\\Users\\Imre\\AppData\\Roaming\\npm',
      'prefer location in AppData\\Roaming',
    )
  
    t.equal(
      findBestGlobalPrefixOnWindows('C:\\foo', {}),
      'C:\\foo',
    )
  
    t.end()
  })
  