forked from github/stable-socket
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkarma.config.cjs
38 lines (36 loc) · 968 Bytes
/
karma.config.cjs
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
28
29
30
31
32
33
34
35
36
37
38
process.env.CHROME_BIN = require('chromium').path
const ws = require('nodejs-websocket')
ws.createServer(function (conn) {
conn.on('text', function (msg) {
if (msg.startsWith('echo:')) {
conn.sendText(msg.replace('echo:', ''))
} else if (msg.startsWith('close:')) {
const code = msg.replace('close:', '')
conn.close(code, 'reason')
}
})
conn.on('error', function (error) {
if (error.code !== 'ECONNRESET') throw error
})
}).listen(7999)
module.exports = function (config) {
config.set({
frameworks: ['mocha', 'chai'],
files: [
{ pattern: 'dist/index.js', type: 'module' },
{ pattern: 'dist/async-tasks.js', type: 'module' },
{ pattern: 'test/test.js', type: 'module' }
],
reporters: ['mocha'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
browsers: ['ChromeHeadless'],
autoWatch: false,
singleRun: true,
concurrency: Infinity
})
}
in
log info
out