Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function describeModule(moduleName, loadDeps, testFn) {
const localSystem = new systemjs.constructor();
localSystem.config({
defaultJSExtensions: true,
baseURL,
meta: {
'*': { format: cliqzConfig.format === 'common' ? 'cjs' : 'register' },
},
});
// list names of all loaded modules so we can unload them after each test
// check `unloadModules`
const systemSet = localSystem.set;
const systemImport = localSystem.import;
let modules = {};
localSystem.set = function (name) {
function describeModule(moduleName, loadDeps, testFn) {
const localSystem = new systemjs.constructor();
localSystem.config({
defaultJSExtensions: true,
baseURL,
meta: {
'*': { format: cliqzConfig.format === 'common' ? 'cjs' : 'register' },
},
});
// list names of all loaded modules so we can unload them after each test
// check `unloadModules`
const systemSet = localSystem.set;
const systemImport = localSystem.import;
let modules = {};
localSystem.set = function (name) {
const cssLoader = createCssLoader({
runtime: this,
});
this.defaultDependencies = defaultDependencies;
// this.defaultExtensions = defaultExtensions;
this.esmLoader = createEsmCdnLoader({ cssLoader });
this.localLoader = createLocalLoader({
cssLoader,
defaultExtensions,
runtimeHost,
});
this.systemLoader = createSystemLoader();
this.queue = Promise.resolve();
// this.runtimeHost = runtimeHost;
this.system = new SystemJS.constructor();
// Hack to force system to never use node's require
this.system._nodeRequire = null;
this.localRoot = this.system.baseURL.replace(
/^([a-zA-Z]+:\/\/)([^/]*)\/.*$/,
'$1$2'
);
this.transpiler =
transpiler === false
? null
: transpiler ||
createTranspiler({
createRuntime,
runtime: this,
runtimeHost,
typescriptVersion: TYPESCRIPT_VERSION,
});
API.Loader = function() {
config.loadSync();
var cfg = config.getLoaderConfig();
var loader = new SystemJSLoader();
loader.config(cfg);
return loader;
};