forked from darkreader/darkreader
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.js
More file actions
27 lines (21 loc) · 759 Bytes
/
Copy pathrun.js
File metadata and controls
27 lines (21 loc) · 759 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// @ts-check
const karma = require('karma');
const path = require('path');
const {createEchoServer} = require('./echo-server');
const ECHO_SERVER_PORT = 9966;
async function run() {
const args = process.argv.slice(2);
const debug = args.includes('--debug');
const karmaConfig = karma.config.parseConfig(path.join(__dirname, './karma.conf.js'), /** @type {any} */({debug}));
const echoServer = await createEchoServer(ECHO_SERVER_PORT);
const karmaServer = new karma.Server(/** @type {any} */(karmaConfig), () => {
echoServer.close();
});
karmaServer.start();
async function stop() {
await /** @type {any} */(karmaServer).stop();
}
process.on('exit', stop);
process.on('SIGINT', stop);
}
run();