summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/npm-registry-client/test/bugs.js
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/node_modules/npm-registry-client/test/bugs.js')
-rw-r--r--deps/npm/node_modules/npm-registry-client/test/bugs.js33
1 files changed, 33 insertions, 0 deletions
diff --git a/deps/npm/node_modules/npm-registry-client/test/bugs.js b/deps/npm/node_modules/npm-registry-client/test/bugs.js
new file mode 100644
index 0000000000..092ec9f791
--- /dev/null
+++ b/deps/npm/node_modules/npm-registry-client/test/bugs.js
@@ -0,0 +1,33 @@
+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
+})
+
+tap.test("get the URL for the bugs page on a package", function (t) {
+ server.expect("GET", "/sample/latest", function (req, res) {
+ t.equal(req.method, "GET")
+
+ res.json({
+ bugs : {
+ url : "http://github.com/example/sample/issues",
+ email : "sample@example.com"
+ }
+ })
+ })
+
+ client.bugs("http://localhost:1337/sample", function (error, info) {
+ t.notOk(error, "no errors")
+ t.ok(info.url, "got the URL")
+ t.ok(info.email, "got the email address")
+
+ t.end()
+ })
+})
+