KJS: introduce $kotlin_test_internal$ to expose some helper functions in the tests

This commit is contained in:
Zalim Bashorov
2017-01-17 22:46:56 +03:00
parent bbd69a05dc
commit ca2930600a
5 changed files with 22 additions and 13 deletions
+11 -7
View File
@@ -2,18 +2,22 @@
var emulatedModules = { kotlin: kotlin };
var module = { exports: {} };
// TODO don't expose by default when run test with AMD module kind
function require(moduleId) {
return emulatedModules[moduleId];
}
function __beginModule__() {
module.exports = {};
}
function __endModule__(moduleId) {
emulatedModules[moduleId] = module.exports;
}
var $kotlin_test_internal$ = {
require: require,
beginModule : function () {
module.exports = {};
},
endModule : function(moduleId) {
emulatedModules[moduleId] = module.exports;
}
};
// TODO expose only when run test with AMD or UMD module kind
function define(moduleId, dependencies, body) {
var resolvedDependencies = [];
emulatedModules[moduleId] = {};