Run kotlin-test-js tests with kotlin-stdlib-js

Rework kotlin-test common tests to make them runnable with qunit.
Change the way how asserter is overridden in js box tests.
Minor: remove unneeded test configs
This commit is contained in:
Ilya Gorbunov
2017-04-19 07:40:22 +03:00
parent f009e0c665
commit ec8ead754f
12 changed files with 80 additions and 118 deletions
+3 -30
View File
@@ -20,7 +20,7 @@ var kotlinJsTestLocation = process.env.KOTLIN_JS_TEST_LOCATION || __dirname + "/
var kotlin = require("kotlin");
var kotlinTest = require(kotlinJsTestLocation);
supplyAsserter(kotlin, kotlinTest);
supplyAsserter(kotlinTest);
var requireFromString = require('require-from-string');
var baseDir = "out";
@@ -102,33 +102,6 @@ function runTest(testRunner, location) {
});
}
function supplyAsserter(kotlin, kotlinTest) {
function AsserterClass() {
}
AsserterClass.prototype.assertTrue_o10pc4$ = function(lazyMessage, actual) {
kotlinTest.kotlin.test.assertTrue_ifx8ge$(actual, lazyMessage());
};
AsserterClass.prototype.assertTrue_4mavae$ = function(message, actual) {
if (!actual) {
this.failWithMessage(message);
}
};
AsserterClass.prototype.assertNotNull_67rc9h$ = kotlinTest.kotlin.test.Asserter.prototype.assertNotNull_67rc9h$;
AsserterClass.prototype.assertEquals_lzc6tz$ = kotlinTest.kotlin.test.Asserter.prototype.assertEquals_lzc6tz$;
AsserterClass.prototype.fail_pdl1vj$ = function(message) {
this.failWithMessage(message);
};
AsserterClass.prototype.failWithMessage = function(message) {
if (message == null) {
throw new Kotlin.AssertionError();
}
else {
throw new Kotlin.AssertionError(message);
}
};
AsserterClass.$metadata$ = {
type: kotlin.Kind.CLASS,
baseClasses: [kotlinTest.kotlin.test.Asserter]
};
kotlinTest.kotlin.test._asserter = new AsserterClass();
function supplyAsserter(kotlinTest) {
kotlinTest.kotlin.test.overrideAsserter_wbnzx$(new kotlinTest.kotlin.test.DefaultAsserter());
}