Sha256: 6d764ddd66f30ad87370cb28277deecb4cf29f9c47df76ae8d2ad2ac1951ce80

Contents?: true

Size: 953 Bytes

Versions: 5

Compression:

Stored size: 953 Bytes

Contents

'use strict'
var test = require('tap').test
var requireInject = require('require-inject')
var log = require('npmlog')

/*
The remove actions need to happen in the opposite of their normally defined
order. That is, they need to go shallow -> deep.
*/

var removed = []
var npm = requireInject.installGlobally('../../lib/npm.js', {
  '../../lib/install/action/remove.js': function (top, buildpath, pkg, log, next) {
    removed.push(pkg.package.name)
    next()
  }
})

test('setup', function (t) {
  npm.load(function () {
    t.pass('npm loaded')
    t.end()
  })
})

test('abc', function (t) {
  var Installer = require('../../lib/install.js').Installer
  var inst = new Installer(__dirname, false, [])
  inst.progress = {executeActions: log}
  inst.todo = [
    ['remove', {package: {name: 'first'}}],
    ['remove', {package: {name: 'second'}}]
  ]
  inst.executeActions(function () {
    t.isDeeply(removed, ['second', 'first'])
    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/uninstall-in-reverse.js
node-compiler-0.9.0 vendor/node-v7.2.1/deps/npm/test/tap/uninstall-in-reverse.js
node-compiler-0.8.0 vendor/node-v7.2.0/deps/npm/test/tap/uninstall-in-reverse.js
node-compiler-0.7.0 vendor/node-v6.9.1/deps/npm/test/tap/uninstall-in-reverse.js
node-compiler-0.7.0 vendor/node-v7.1.0/deps/npm/test/tap/uninstall-in-reverse.js