forked from github/stable-socket
-
Notifications
You must be signed in to change notification settings - Fork 0
/
karma.config.cjs
34 lines (32 loc) · 893 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
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
})
}