1 var common = require('../common-tap.js')
2 var test = require('tap').test
4 var osenv = require('osenv')
5 var pkg = process.env.npm_config_tmp || '/tmp'
6 pkg += '/npm-test-publish-config'
8 require('mkdirp').sync(pkg)
10 fs.writeFileSync(pkg + '/package.json', JSON.stringify({
11 name: 'npm-test-publish-config',
13 publishConfig: { registry: common.registry }
16 var spawn = require('child_process').spawn
17 var npm = require.resolve('../../bin/npm-cli.js')
18 var node = process.execPath
22 require('http').createServer(function (req, res) {
23 t.pass('got request on the fakey fake registry')
27 res.end('{"error":"sshhh. naptime nao. \\^O^/ <(YAWWWWN!)"}')
29 }).listen(common.port, function () {
30 t.pass('server is listening')
32 // don't much care about listening to the child's results
33 // just wanna make sure it hits the server we just set up.
35 // there are plenty of other tests to verify that publish
36 // itself functions normally.
38 // Make sure that we don't sit around waiting for lock files
39 child = spawn(node, [npm, 'publish', '--email=fancy', '--_auth=feast'], {
42 npm_config_cache_lock_stale: 1000,
43 npm_config_cache_lock_wait: 1000,
44 HOME: process.env.HOME,
45 Path: process.env.PATH,
46 PATH: process.env.PATH,
47 USERPROFILE: osenv.home()