diff options
Diffstat (limited to 'deps/node/deps/npm/test/tap/update-path.js')
-rw-r--r-- | deps/node/deps/npm/test/tap/update-path.js | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/deps/node/deps/npm/test/tap/update-path.js b/deps/node/deps/npm/test/tap/update-path.js new file mode 100644 index 00000000..1578669a --- /dev/null +++ b/deps/node/deps/npm/test/tap/update-path.js @@ -0,0 +1,35 @@ +'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() + }) +}) |