[JS] Implement strategy with adapterTransformer on global object to mutate adapter of kotlin-test
This commit is contained in:
@@ -1,19 +1,16 @@
|
||||
import {CliArgsParser, getDefaultCliDescription} from "./src/CliArgsParser";
|
||||
import {runWithFilteringAndConsoleAdapters} from "./src/Adapter";
|
||||
import {KotlinTestRunner} from "./src/KotlinTestRunner";
|
||||
|
||||
let kotlin_test
|
||||
try {
|
||||
kotlin_test = require('kotlin-test');
|
||||
} catch {
|
||||
}
|
||||
const parser = new CliArgsParser(
|
||||
getDefaultCliDescription(),
|
||||
process.exit
|
||||
);
|
||||
const untypedArgs = parser.parse(process.argv);
|
||||
|
||||
if (kotlin_test) {
|
||||
const parser = new CliArgsParser(
|
||||
getDefaultCliDescription(),
|
||||
process.exit
|
||||
);
|
||||
const untypedArgs = parser.parse(process.argv);
|
||||
const adapterTransformer: (current: KotlinTestRunner) => KotlinTestRunner = current =>
|
||||
runWithFilteringAndConsoleAdapters(current, untypedArgs);
|
||||
|
||||
const initialAdapter = kotlin_test.kotlin.test.detectAdapter_8be2vx$();
|
||||
kotlin_test.setAdapter(runWithFilteringAndConsoleAdapters(initialAdapter, untypedArgs));
|
||||
(globalThis as any).kotlinTest = {
|
||||
adapterTransformer: adapterTransformer
|
||||
}
|
||||
Reference in New Issue
Block a user