summaryrefslogtreecommitdiff
path: root/deps/npm/test/tap/outdated.js
blob: 67af4fcccdfc3d03f6e6eaaada41835331565110 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
var fs = require("fs")
var test = require("tap").test
var rimraf = require("rimraf")
var npm = require("../../")

var mr = require("npm-registry-mock")
// config
var port = 1331
var address = "http://localhost:" + port
var pkg = __dirname + '/outdated'

test("it should not throw", function (t) {
  rimraf.sync(pkg + "/node_modules")
  process.chdir(pkg)

  mr(port, function (s) {
    npm.load({registry: address}, function () {
      npm.install(".", function (err) {
        npm.outdated(function (er, d) {
          console.log(d)
          s.close()
          t.end()
        })
      })
    })
  })
})

test("cleanup", function (t) {
  rimraf.sync(pkg + "/node_modules")
  t.end()
})