mirror of
https://github.com/S2-/minifyfromhtml.git
synced 2025-08-03 20:30:04 +02:00
update packages to latest version
This commit is contained in:
79
node_modules/npm/test/tap/uninstall-package.js
generated
vendored
Normal file
79
node_modules/npm/test/tap/uninstall-package.js
generated
vendored
Normal file
@@ -0,0 +1,79 @@
|
||||
var fs = require('graceful-fs')
|
||||
var path = require('path')
|
||||
|
||||
var mkdirp = require('mkdirp')
|
||||
var mr = require('npm-registry-mock')
|
||||
var osenv = require('osenv')
|
||||
var rimraf = require('rimraf')
|
||||
var test = require('tap').test
|
||||
|
||||
var common = require('../common-tap.js')
|
||||
|
||||
var pkg = path.join(__dirname, 'uninstall-package')
|
||||
|
||||
var EXEC_OPTS = { cwd: pkg }
|
||||
|
||||
var json = {
|
||||
name: 'uninstall-package',
|
||||
version: '0.0.0',
|
||||
dependencies: {
|
||||
underscore: '~1.3.1',
|
||||
request: '~0.9.0'
|
||||
}
|
||||
}
|
||||
|
||||
test('setup', function (t) {
|
||||
cleanup()
|
||||
mkdirp.sync(pkg)
|
||||
process.chdir(pkg)
|
||||
fs.writeFileSync(
|
||||
path.join(pkg, 'package.json'),
|
||||
JSON.stringify(json, null, 2)
|
||||
)
|
||||
|
||||
t.end()
|
||||
})
|
||||
|
||||
test('returns a list of removed items', function (t) {
|
||||
mr({ port: common.port }, function (er, s) {
|
||||
common.npm(
|
||||
[
|
||||
'--registry', common.registry,
|
||||
'--loglevel', 'silent',
|
||||
'install', '.'
|
||||
],
|
||||
EXEC_OPTS,
|
||||
function (err, code, stdout, stderr) {
|
||||
t.ifError(err, 'install ran without issue')
|
||||
t.notOk(code, 'install ran without raising error code')
|
||||
common.npm(
|
||||
[
|
||||
'--registry', common.registry,
|
||||
'--loglevel', 'silent',
|
||||
'uninstall', 'underscore', 'request', 'lala'
|
||||
],
|
||||
EXEC_OPTS,
|
||||
function (err, code, stdout, stderr) {
|
||||
t.ifError(err, 'uninstall ran without issue')
|
||||
t.notOk(code, 'uninstall ran without raising error code')
|
||||
t.has(stdout, /unbuild underscore@1.3.3/, 'underscore uninstalled')
|
||||
t.has(stdout, /unbuild request@0.9.5/, 'request uninstalled')
|
||||
|
||||
s.close()
|
||||
t.end()
|
||||
}
|
||||
)
|
||||
}
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
test('cleanup', function (t) {
|
||||
cleanup()
|
||||
t.end()
|
||||
})
|
||||
|
||||
function cleanup () {
|
||||
process.chdir(osenv.tmpdir())
|
||||
rimraf.sync(pkg)
|
||||
}
|
Reference in New Issue
Block a user