All files / ima test.js

75% Statements 15/20
50% Branches 7/14
25% Functions 2/8
75% Lines 15/20
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 4331x 31x 31x 31x 31x   31x                       31x 31x 31x     15x 231x 231x   231x         1x 1x                  
var root = typeof window !== 'undefined' && window !== null ? window : global;
root.$IMA = root.$IMA || {};
root.$IMA.Test = true;
root.$IMA.$Debug = true;
root.$Debug = true;
 
root.$IMA.Loader = root.$IMA.Loader || {
  register: function() {},
  replaceModule: function() {},
  import: function() {
    return Promise.resolve();
  },
  importSync: function() {},
  initAllModules: function() {
    return Promise.resolve();
  }
};
 
root.extend = extend;
root.using = using;
root.$import = $import;
 
function using(values, func) {
  for (var i = 0, count = values.length; i < count; i++) {
    Eif (Object.prototype.toString.call(values[i]) !== '[object Array]') {
      values[i] = [values[i]];
    }
    func.apply(this, values[i]);
  }
}
 
function extend(ChildClass, ParentClass) {
  ChildClass.prototype = new ParentClass();
  ChildClass.prototype.constructor = ChildClass;
}
 
function $import(path, name) {
  var module = $IMA.Loader.importSync(path);
  name = name || 'default';
 
  return name === '*' ? module : module[name];
}