webgme-codeeditor
Version:
Code Editor Visualizer for webgme using CodeMirror
32 lines (25 loc) • 945 B
JavaScript
// This is used by the test/plugins tests
/*globals requireJS*/
/*jshint node:true*/
/**
* @author pmeijer / https://github.com/pmeijer
*/
;
var testFixture = require('webgme/test/_globals'),
WEBGME_CONFIG_PATH = '../config';
// This flag will make sure the config.test.js is being used
// process.env.NODE_ENV = 'test'; // This is set by the require above, overwrite it here.
var WebGME = testFixture.WebGME,
gmeConfig = require(WEBGME_CONFIG_PATH),
getGmeConfig = function getGmeConfig() {
'use strict';
// makes sure that for each request it returns with a unique object and tests will not interfere
if (!gmeConfig) {
// if some tests are deleting or unloading the config
gmeConfig = require(WEBGME_CONFIG_PATH);
}
return JSON.parse(JSON.stringify(gmeConfig));
};
WebGME.addToRequireJsPaths(gmeConfig);
testFixture.getGmeConfig = getGmeConfig;
module.exports = testFixture;