X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.maps.server%2Fnode%2Fnode-v4.8.0-win-x64%2Fnode_modules%2Fnpm%2Ftest%2Ftap%2Fpublish-config.js;fp=org.simantics.maps.server%2Fnode%2Fnode-v4.8.0-win-x64%2Fnode_modules%2Fnpm%2Ftest%2Ftap%2Fpublish-config.js;h=1d063535b84987edb63c841d33530eb3f1c7d82e;hb=2529be6d456deeb07c128603ce4971f1dc29b695;hp=0000000000000000000000000000000000000000;hpb=2636fc31c16c23711cf2b06a4ae8537bba9c1d35;p=simantics%2Fdistrict.git diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/publish-config.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/publish-config.js new file mode 100644 index 00000000..1d063535 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/publish-config.js @@ -0,0 +1,59 @@ +var common = require("../common-tap.js") +var test = require("tap").test +var fs = require("fs") +var osenv = require("osenv") +var pkg = process.env.npm_config_tmp || "/tmp" +pkg += "/npm-test-publish-config" + +require("mkdirp").sync(pkg) + +fs.writeFileSync(pkg + "/package.json", JSON.stringify({ + name: "npm-test-publish-config", + version: "1.2.3", + publishConfig: { registry: common.registry } +}), "utf8") + +fs.writeFileSync(pkg + "/fixture_npmrc", + "//localhost:1337/:email = fancy@feast.net\n" + + "//localhost:1337/:username = fancy\n" + + "//localhost:1337/:_password = " + new Buffer("feast").toString("base64") + "\n" + + "registry = http://localhost:1337/") + +test(function (t) { + var child + t.plan(4) + require("http").createServer(function (req, res) { + t.pass("got request on the fakey fake registry") + this.close() + res.statusCode = 500 + res.end(JSON.stringify({ + error: "sshhh. naptime nao. \\^O^/ <(YAWWWWN!)" + })) + child.kill('SIGHUP') + }).listen(common.port, function () { + t.pass("server is listening") + + // don't much care about listening to the child's results + // just wanna make sure it hits the server we just set up. + // + // there are plenty of other tests to verify that publish + // itself functions normally. + // + // Make sure that we don't sit around waiting for lock files + child = common.npm(["publish", "--userconfig=" + pkg + "/fixture_npmrc"], { + cwd: pkg, + stdio: "inherit", + env: { + "npm_config_cache_lock_stale": 1000, + "npm_config_cache_lock_wait": 1000, + HOME: process.env.HOME, + Path: process.env.PATH, + PATH: process.env.PATH, + USERPROFILE: osenv.home() + } + }, function (err, code) { + t.ifError(err, "publish command finished successfully") + t.notOk(code, "npm install exited with code 0") + }) + }) +})