2016-12-09 08:05:15 +00:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
const mockery = require('mockery');
|
|
|
|
|
|
|
|
module.exports = function(realmModulePath) {
|
|
|
|
if (typeof REALM_MODULE_PATH !== 'undefined')
|
|
|
|
return;
|
|
|
|
|
|
|
|
global.REALM_MODULE_PATH = realmModulePath;
|
|
|
|
|
|
|
|
mockery.enable({
|
|
|
|
warnOnReplace: false,
|
|
|
|
warnOnUnregistered: false
|
|
|
|
});
|
2016-12-29 09:53:51 +00:00
|
|
|
mockery.registerSubstitute('realm', REALM_MODULE_PATH); // eslint-disable-line no-undef
|
2016-12-09 08:05:15 +00:00
|
|
|
}
|