mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-24 01:16:15 -04:00
use settings for backend tests
This commit is contained in:
parent
e48d605d2d
commit
d803ac128e
4 changed files with 23 additions and 3 deletions
17
tests/backend/loadSettings.js
Normal file
17
tests/backend/loadSettings.js
Normal file
|
@ -0,0 +1,17 @@
|
|||
var jsonminify = require(__dirname+"/../../src/node_modules/jsonminify");
|
||||
|
||||
function loadSettings(){
|
||||
var settingsStr = fs.readFileSync(__dirname+"/../../settings.json").toString();
|
||||
// try to parse the settings
|
||||
var settings;
|
||||
try {
|
||||
if(settingsStr) {
|
||||
settingsStr = jsonminify(settingsStr).replace(",]","]").replace(",}","}");
|
||||
return JSON.parse(settingsStr);
|
||||
}
|
||||
}catch(e){
|
||||
console.error("whoops something is bad with settings");
|
||||
}
|
||||
}
|
||||
|
||||
exports.loadSettings = loadSettings;
|
Loading…
Add table
Add a link
Reference in a new issue