You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

52 lines
1.1 KiB

var common = require("../common-tap")
, path = require("path")
, test = require("tap").test
, rimraf = require("rimraf")
, npm = require("../../")
, mr = require("npm-registry-mock")
, pkg = path.resolve(__dirname, "outdated-depth")
, cache = path.resolve(pkg, "cache")
, nodeModules = path.resolve(pkg, "node_modules")
function cleanup () {
rimraf.sync(nodeModules)
rimraf.sync(cache)
}
test("outdated depth zero", function (t) {
var expected = [
pkg,
"underscore",
"1.3.1",
"1.3.1",
"1.5.1",
"1.3.1"
]
process.chdir(pkg)
mr({port : common.port}, function (er, s) {
npm.load({
cache: cache
, loglevel: "silent"
, registry: common.registry
}
, function () {
npm.install(".", function (er) {
if (er) throw new Error(er)
npm.outdated(function (err, d) {
if (err) throw new Error(err)
t.deepEqual(d[0], expected)
s.close()
t.end()
})
})
}
)
})
})
test("cleanup", function (t) {
cleanup()
t.end()
})