diff options
author | Kat Marchán <kzm@sykosomatic.org> | 2015-09-04 14:48:13 -0700 |
---|---|---|
committer | Rod Vagg <rod@vagg.org> | 2015-09-06 21:38:10 +1000 |
commit | ba02bd02e91773be161e03a9ed67745fba8f22db (patch) | |
tree | bdebc233876a6b7f276c1e12be44bec204e8ef09 /deps/npm/test/tap | |
parent | d15ba80d6f7a473a70081768500260429ecb6218 (diff) | |
download | node-new-ba02bd02e91773be161e03a9ed67745fba8f22db.tar.gz |
deps: create .npmrc during npm tests
This patch should make the tests pass on the downstreamed npm.
PR-URL: https://github.com/nodejs/node/pull/2696
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Rod Vagg <rod@vagg.org>
Diffstat (limited to 'deps/npm/test/tap')
-rw-r--r-- | deps/npm/test/tap/00-config-setup.js | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/deps/npm/test/tap/00-config-setup.js b/deps/npm/test/tap/00-config-setup.js index 33581eb138..0daf0decd6 100644 --- a/deps/npm/test/tap/00-config-setup.js +++ b/deps/npm/test/tap/00-config-setup.js @@ -1,3 +1,4 @@ +var fs = require("graceful-fs") var path = require("path") var userconfigSrc = path.resolve(__dirname, "..", "fixtures", "config", "userconfig") exports.userconfig = userconfigSrc + "-with-gc" @@ -55,10 +56,24 @@ exports.envDataFix = { "other-env-thing": 1000 } +var projectConf = path.resolve(__dirname, '..', '..', '.npmrc') +try { + fs.statSync(projectConf) +} catch (er) { + // project conf not found, probably working with packed npm + fs.writeFileSync(projectConf, 'save-prefix = ~\nproprietary-attribs = false\n') +} + +var projectRc = path.join(__dirname, '..', 'fixtures', 'config', '.npmrc') +try { + fs.statSync(projectRc) +} catch (er) { + // project conf not found, probably working with packed npm + fs.writeFileSync(projectRc, 'just = testing') +} if (module === require.main) { // set the globalconfig in the userconfig - var fs = require("fs") var uc = fs.readFileSync(userconfigSrc) var gcini = "globalconfig = " + exports.globalconfig + "\n" fs.writeFileSync(exports.userconfig, gcini + uc) |