Skip to content

Commit

Permalink
test config picks up host (and admin credentials) from master config
Browse files Browse the repository at this point in the history
  • Loading branch information
jchris committed Apr 17, 2012
1 parent 7f523a6 commit bd5878f
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion test/testConfig.js
@@ -1,5 +1,20 @@
var fs = require('fs'),
path = require("path"),
configPath = path.join(__dirname, "..","config.json"),
ok = false,
config = fs.readFileSync(configPath, "utf8");

try {
config = JSON.parse(config);
ok = true;
} catch (e) {
console.error("could not read config.json, please use `npm start syncpoint` to set up your installation: "+configPath);
}

// we use the configured host but test databases.
// if there is a test_host configured we use that instead
module.exports = {
"host" : "http://Administrator:ok@localhost:5984",
"host" : config.test_host || config.host,
"admin_db" : "test_sp_admin",
"users_db" : "test_sp_users"
}

0 comments on commit bd5878f

Please sign in to comment.