-
Notifications
You must be signed in to change notification settings - Fork 0
/
karma.conf.js
38 lines (35 loc) · 1.04 KB
/
karma.conf.js
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
const realBrowser = String(process.env.BROWSER).match(/^(1|true)$/gi)
const travisLaunchers = {
chrome_travis: {
base: 'Chrome',
flags: ['--no-sandbox']
}
}
const localBrowsers = realBrowser ? Object.keys(travisLaunchers) : ['Chrome']
module.exports = (config) => {
const env = process.env['NODE_ENV'] || 'development'
config.set({
frameworks: ['jasmine', 'karma-typescript'],
plugins: [
'karma-jasmine',
'karma-typescript',
'karma-chrome-launcher',
'karma-jasmine-html-reporter',
'karma-spec-reporter'
],
client: {
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
files: [{ pattern: 'src/**/*.ts' }, { pattern: 'test/**/*.spec.ts' }],
preprocessors: {
'**/*.ts': ['karma-typescript'],
'test/**/*.spec.ts': ['karma-typescript']
},
reporters: ['progress', 'kjhtml'],
colors: true,
logLevel: env === 'debug' ? config.LOG_DEBUG : config.LOG_INFO,
autoWatch: true,
browsers: localBrowsers,
singleRun: false
})
}