forked from improbable-eng/grpc-web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkarma.conf.ts
57 lines (55 loc) · 1.51 KB
/
karma.conf.ts
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import * as fs from 'fs';
import customLaunchers from './browsers';
import customKarmaDriver from './custom-karma-driver';
import {testHost} from './hosts-config';
export default (config) => {
const DEBUG = process.env.DEBUG !== undefined;
const useBrowserStack = process.env.BROWSER_STACK_USERNAME !== undefined;
const browsers = useBrowserStack ? Object.keys(customLaunchers) : [];
config.set({
basePath: '',
frameworks: ['jasmine'],
browserStack: {
forcelocal: true
},
files: [
'ts/build/integration-tests.js'
],
preprocessors: {
'**/*.js': ['sourcemap', 'config-inject']
},
reporters: ['dots'],
protocol: 'https',
hostname: testHost,
port: 9876,
httpsServerOptions: {
key: fs.readFileSync('../misc/localhost.key', 'utf8'),
cert: fs.readFileSync('../misc/localhost.crt', 'utf8')
},
colors: true,
logLevel: DEBUG ? 'DEBUG' : 'INFO',
client: {
captureConsole: true,
runInParent: true,
useIframe: false
},
plugins: [
customKarmaDriver,
{'preprocessor:config-inject': [
'factory', () =>
(content, file, done) =>
done(`window.DEBUG = ${DEBUG};\n${content}`)
]},
'karma-sourcemap-loader',
'karma-jasmine'
],
autoWatch: true,
captureTimeout: 120000,
browserDisconnectTimeout: 60000,
browserNoActivityTimeout: 60000,
singlerun: useBrowserStack,
concurrency: 2,
customLaunchers: customLaunchers,
browsers: browsers
});
};