UNPKG

887 BJavaScriptView Raw
1var testFixture = require('webgme/test/_globals'),
2 WEBGME_CONFIG_PATH = '../config';
3
4// This flag will make sure the config.test.js is being used
5// process.env.NODE_ENV = 'test'; // This is set by the require above, overwrite it here.
6
7var WebGME = testFixture.WebGME,
8 gmeConfig = require(WEBGME_CONFIG_PATH),
9 _logger,
10 getGmeConfig = function getGmeConfig() {
11 // makes sure that for each request it returns with a unique object and tests will not interfere
12 if (!gmeConfig) {
13 // if some tests are deleting or unloading the config
14 gmeConfig = require(WEBGME_CONFIG_PATH);
15 WebGME.addToRequireJsPaths(gmeConfig);
16 }
17
18 return JSON.parse(JSON.stringify(gmeConfig));
19 };
20
21WebGME.addToRequireJsPaths(gmeConfig);
22testFixture.getGmeConfig = getGmeConfig;
23
24module.exports = testFixture;