1 var common = require("../common-tap.js")
2 var test = require("tap").test
3 var http = require("http")
5 test("should send referer http header", function (t) {
6 http.createServer(function (q, s) {
7 t.equal(q.headers.referer, "install foo")
9 s.end(JSON.stringify({error: "whatever"}))
11 }).listen(common.port, function () {
12 var reg = "http://localhost:" + common.port
13 var args = [ "install", "foo", "--registry", reg ]
14 common.npm(args, {}, function (er, code) {
18 // should not have ended nicely, since we returned an error