summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/npm-registry-client/test/publish-again.js
diff options
context:
space:
mode:
authorForrest L Norvell <ogd@aoaioxxysz.net>2015-01-08 14:37:26 -0800
committerBen Noordhuis <info@bnoordhuis.nl>2015-01-08 23:49:03 +0100
commite79ccee1685393e4ec73746bac93835cbcf3a809 (patch)
tree304a1ddd59495b50a20d1b25c62da2a4519228db /deps/npm/node_modules/npm-registry-client/test/publish-again.js
parent156cd82ef4d2ff4fa291407de562c3a7c2386dc7 (diff)
downloadnode-new-e79ccee1685393e4ec73746bac93835cbcf3a809.tar.gz
npm: upgrade to v2.1.18
PR-URL: https://github.com/iojs/io.js/pull/266 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'deps/npm/node_modules/npm-registry-client/test/publish-again.js')
-rw-r--r--deps/npm/node_modules/npm-registry-client/test/publish-again.js26
1 files changed, 16 insertions, 10 deletions
diff --git a/deps/npm/node_modules/npm-registry-client/test/publish-again.js b/deps/npm/node_modules/npm-registry-client/test/publish-again.js
index 39c368fd35..9c547ca010 100644
--- a/deps/npm/node_modules/npm-registry-client/test/publish-again.js
+++ b/deps/npm/node_modules/npm-registry-client/test/publish-again.js
@@ -4,19 +4,20 @@ var fs = require("fs")
var server = require("./lib/server.js")
var common = require("./lib/common.js")
-var nerfed = "//localhost:" + server.port + "/:"
+var auth = {
+ username : "username",
+ password : "%1234@asdf%",
+ email : "i@izs.me",
+ alwaysAuth : true
+}
-var configuration = {}
-configuration[nerfed + "username"] = "username"
-configuration[nerfed + "_password"] = new Buffer("%1234@asdf%").toString("base64")
-configuration[nerfed + "email"] = "i@izs.me"
-
-var client = common.freshClient(configuration)
+var client = common.freshClient()
tap.test("publish again", function (t) {
// not really a tarball, but doesn't matter
- var tarball = require.resolve("../package.json")
- var pd = fs.readFileSync(tarball, "base64")
+ var bodyPath = require.resolve("../package.json")
+ var tarball = fs.createReadStream(bodyPath, "base64")
+ var pd = fs.readFileSync(bodyPath, "base64")
var pkg = require("../package.json")
var lastTime = null
@@ -73,7 +74,12 @@ tap.test("publish again", function (t) {
})
})
- client.publish("http://localhost:1337/", pkg, tarball, function (er, data) {
+ var params = {
+ metadata : pkg,
+ body : tarball,
+ auth : auth
+ }
+ client.publish("http://localhost:1337/", params, function (er, data) {
if (er) throw er
t.deepEqual(data, { created: true })
t.end()