Sha256: c9718fab542dcb09af24bd55eae1be37f0116078126cb85f16ec4fb1be8ecdd1

Contents?: true

Size: 881 Bytes

Versions: 5

Compression:

Stored size: 881 Bytes

Contents

'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()
  })
})

Version data entries

5 entries across 4 versions & 1 rubygems

Version Path
node-compiler-0.9.1 vendor/node/deps/npm/test/tap/update-path.js
node-compiler-0.9.0 vendor/node-v7.2.1/deps/npm/test/tap/update-path.js
node-compiler-0.8.0 vendor/node-v7.2.0/deps/npm/test/tap/update-path.js
node-compiler-0.7.0 vendor/node-v6.9.1/deps/npm/test/tap/update-path.js
node-compiler-0.7.0 vendor/node-v7.1.0/deps/npm/test/tap/update-path.js