[Debugger, JS] Rename karma-debug on karma-debug-runner

This commit is contained in:
Ilya Goncharov
2019-11-18 16:15:08 +03:00
parent 5f8a5d5fca
commit 15a606c2b6
4 changed files with 4 additions and 4 deletions
@@ -0,0 +1,38 @@
/*
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
'use strict';
import {configureBrowsers, fixMochaTimeout} from "./src/DebugConfigurator";
const karma = require('karma');
const cfg = karma.config;
const karmaConfig = cfg.parseConfig(process.argv[2]);
karmaConfig.singleRun = false;
configureBrowsers(karmaConfig);
fixMochaTimeout(karmaConfig);
const Server = karma.Server;
const server = new Server(karmaConfig, function (exitCode) {
console.log('Karma has exited with ' + exitCode);
});
server.on('browsers_ready', function () {
// It is unreliable decision, but we need some delay for debugger attaching
setTimeout(function () {
karma.runner.run(karmaConfig, function (exitCode) {
console.log('Runner has exited with ' + exitCode);
karma.stopper.stop(karmaConfig, function (exitCode) {
console.log('Stopper has exited with ' + exitCode);
})
})
}, 1000)
});
server.start();