diff options
Diffstat (limited to 'deps/npm/node_modules/npm-registry-client/test/unpublish-scoped.js')
-rw-r--r-- | deps/npm/node_modules/npm-registry-client/test/unpublish-scoped.js | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/deps/npm/node_modules/npm-registry-client/test/unpublish-scoped.js b/deps/npm/node_modules/npm-registry-client/test/unpublish-scoped.js index 0e5cb8606d..88ee13f377 100644 --- a/deps/npm/node_modules/npm-registry-client/test/unpublish-scoped.js +++ b/deps/npm/node_modules/npm-registry-client/test/unpublish-scoped.js @@ -2,18 +2,22 @@ var tap = require("tap") var server = require("./lib/server.js") var common = require("./lib/common.js") - -var nerfed = "//localhost:" + server.port + "/:" - -var configuration = {} -configuration[nerfed + "_authToken"] = "of-glad-tidings" - -var client = common.freshClient(configuration) +var client = common.freshClient() var cache = require("./fixtures/@npm/npm-registry-client/cache.json") -var REV = "/-rev/213-0a1049cf56172b7d9a1184742c6477b9" +var REV = "/-rev/213-0a1049cf56172b7d9a1184742c6477b9" +var PACKAGE = "/@npm%2fnpm-registry-client" +var URI = common.registry + PACKAGE +var TOKEN = "of-glad-tidings" var VERSION = "3.0.6" +var AUTH = { + token : TOKEN +} +var PARAMS = { + version : VERSION, + auth : AUTH +} tap.test("unpublish a package", function (t) { server.expect("GET", "/@npm%2fnpm-registry-client?write=true", function (req, res) { @@ -39,20 +43,20 @@ tap.test("unpublish a package", function (t) { res.json(cache) }) - server.expect("GET", "/@npm%2fnpm-registry-client", function (req, res) { + server.expect("GET", PACKAGE, function (req, res) { t.equal(req.method, "GET") res.json(cache) }) - server.expect("DELETE", "/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-" + VERSION + ".tgz" + REV, function (req, res) { + server.expect("DELETE", PACKAGE+"/-"+PACKAGE+"-"+VERSION+".tgz"+REV, function (req, res) { t.equal(req.method, "DELETE") res.json({unpublished:true}) }) - client.unpublish("http://localhost:1337/@npm%2fnpm-registry-client", VERSION, function (error) { - t.ifError(error, "no errors") + client.unpublish(URI, PARAMS, function (er) { + t.ifError(er, "no errors") t.end() }) |