[Gradle, JS] Improvements of kotlin test adapters

- divide adapter.js into different files, which frameworks could load separately
- possibility to inject something to kotlin-test adapter by user

^KT-54418 fixed
This commit is contained in:
Ilya Goncharov
2022-10-12 14:14:50 +00:00
committed by Space Team
parent d423782fac
commit b01411544a
4 changed files with 19 additions and 55 deletions
+10 -2
View File
@@ -13,10 +13,18 @@ const parser = new CliArgsParser(
throw new Error(`Exit with ${exitCode}`)
}
);
const untypedArgs = parser.parse(window.__karma__.config.args);
const adapterTransformer: (current: KotlinTestRunner) => KotlinTestRunner = current =>
runWithFilteringAndConsoleAdapters(current, untypedArgs);
let adapterTransformer: (current: KotlinTestRunner) => KotlinTestRunner
if (window.kotlinTest) {
const currentAdapterTransformer = window.kotlinTest.adapterTransformer;
adapterTransformer = current =>
runWithFilteringAndConsoleAdapters(currentAdapterTransformer(current), untypedArgs);
} else {
adapterTransformer = current =>
runWithFilteringAndConsoleAdapters(current, untypedArgs);
}
window.kotlinTest = {
adapterTransformer: adapterTransformer