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

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/npm-registry-client/test/upload.js')
-rw-r--r--node_modules/npm-registry-client/test/upload.js37
1 files changed, 37 insertions, 0 deletions
diff --git a/node_modules/npm-registry-client/test/upload.js b/node_modules/npm-registry-client/test/upload.js
new file mode 100644
index 000000000..8884db8f3
--- /dev/null
+++ b/node_modules/npm-registry-client/test/upload.js
@@ -0,0 +1,37 @@
+var tap = require("tap")
+var Readable = require("stream").Readable
+var inherits = require("util").inherits
+
+var common = require("./lib/common.js")
+var server = require("./lib/server.js")
+
+var cache = require("./fixtures/underscore/cache.json")
+
+var client = common.freshClient({
+ username : "othiym23",
+ password : "password",
+ email : "ogd@aoaioxxysz.net",
+ _auth : new Buffer("username : password").toString("base64"),
+ "always-auth" : true
+})
+
+function OneA() {
+ Readable.call(this)
+ this.push("A")
+ this.push(null)
+}
+inherits(OneA, Readable)
+
+tap.test("unpublish a package", function (t) {
+ server.expect("PUT", "/underscore", function (req, res) {
+ t.equal(req.method, "PUT")
+
+ res.json(cache)
+ })
+
+ client.upload("http://localhost:1337/underscore", new OneA(), "daedabeefa", true, function (error) {
+ t.notOk(error, "no errors")
+
+ t.end()
+ })
+})