1 var test = require("tap").test
2 var npm = require("../..")
3 var path = require("path")
4 var rimraf = require("rimraf")
5 var npmrc = path.join(__dirname, "npmrc")
8 test("setup", function (t) {
9 fs.writeFileSync(npmrc, "foo = bar\n", "ascii")
13 test("calling set/get on config pre-load should throw", function (t) {
19 t.equal(er.message, "npm.load() required")
21 t.ok(threw, "get before load should throw")
26 npm.config.set("foo", "bar")
29 t.equal(er.message, "npm.load() required")
31 t.ok(threw, "set before load should throw")
34 npm.load({ userconfig: npmrc }, function (er) {
37 t.equal(npm.config.get("foo"), "bar")
38 npm.config.set("foo", "baz")
39 t.equal(npm.config.get("foo"), "baz")
44 test("cleanup", function (t) {