Welcome to mirror list, hosted at ThFree Co, Russian Federation.

stars.js « test « npm-registry-client « node_modules - github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 64835c02a623e42691ba1571c5ad987830f7828e (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 tap = require("tap")

var server = require("./lib/server.js")
var common = require("./lib/common.js")
var client = common.freshClient({
  username      : "username",
  password      : "password",
  email         : "ogd@aoaioxxysz.net",
  _auth         : new Buffer("username  : password").toString("base64"),
  "always-auth" : true
})

var users = [
  "benjamincoe",
  "seldo",
  "ceejbot"
]

tap.test("get the URL for the bugs page on a package", function (t) {
  server.expect("GET", "/-/_view/starredByUser?key=%22sample%22", function (req, res) {
    t.equal(req.method, "GET")

    res.json(users)
  })

  client.stars("http://localhost:1337/", "sample", function (error, info) {
    t.notOk(error, "no errors")
    t.deepEqual(info, users, "got the list of users")

    t.end()
  })
})