HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers10/douven.komma.pro/node_modules/npm/test/tap/update-path.js
'use strict'
var test = require('tap').test
var requireInject = require('require-inject')

var mockNpm = {
  config: {
    get: function (key) {
      return false
    }
  },
  commands: {
    outdated: function (args, silent, cb) {
      cb(null, [
        [{path: '/incorrect', parent: {path: '/correct'}}, 'abc', '1.0.0', '1.1.0', '1.1.0', '^1.1.0']
      ])
    }
  }
}

// What we're testing here is that updates use the parent module's path to
// install from.
test('update', function (t) {
  var update = requireInject('../../lib/update.js', {
    '../../lib/npm.js': mockNpm,
    '../../lib/install.js': {
      'Installer': function (where, dryrun, args) {
        t.is(where, '/correct', 'We should be installing to the parent of the modules being updated')
        this.run = function (cb) { cb() }
      }
    }
  })
  update(['abc'], function () {
    t.end()
  })
})