forked from AckerApple/angular-file
-
Notifications
You must be signed in to change notification settings - Fork 0
/
karma.conf.js
73 lines (64 loc) · 1.88 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
const browserIndex = process.argv.indexOf('--browser')
const browserArg = browserIndex>=0 ? process.argv[browserIndex+1] : ''
const setup = {
//basePath: '',
basePath: 'src',
frameworks: [
'jasmine',
//'karma-typescript',
'@angular/cli'
],
//preprocessors: {
// "**/*.ts": ["karma-typescript"] // *.tsx for React Jsx
//},
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher')
//,require('karma-typescript')
//,require('karma-remap-istanbul')
],
browsers: [], /* add PhatomJS here */
//singleRun: false,
browserDisconnectTolerance : 2,
browserNoActivityTimeout : 20000,
browserDisconnectTimeout : 5000,
reporters: ['progress'],//['progress','karma-typescript'],//['dots', 'karma-remap-istanbul'],//['progress'],//'dots',
mime: { 'text/x-typescript': ['ts','tsx'] },
client: { captureConsole: true }
}
//setup.preprocessors = {
// '**/*.spec.ts': ['@angular/cli']
//}
//setup.files = [
// {pattern: '**/*.spec.ts', included: true}
//]
/*
setup.preprocessors = {
'./test/test.ts': ['@angular/cli']
}
setup.files = [
{pattern: './test/test.ts', watched: false}
]
*/
//setup.files = [{pattern: '**/*.spec.ts', included: true}]
//setup.files = ['src/index']
//setup.files = ['src/**/*.spec.ts']
/*setup.angularCli = {
config: './angular-cli.json',
environment: 'dev'
}*/
if( browserArg=='PhantomJS' ){
setup.browsers.push('Chrome')
setup.browsers.push('PhantomJS')
setup.plugins.push( require('karma-phantomjs-launcher') )
setup.plugins.push( require('karma-jasmine-html-reporter') )
setup.plugins.push( require('karma-coverage-istanbul-reporter') )
}else{
setup.browsers.push('Chrome')
setup.customLaunchers = require('./test/sauce-browsers').customLaunchers()
}
setup.plugins.push( require('@angular/cli/plugins/karma') )
module.exports = function (config) {
setup.logLevel = config.LOG_INFO
config.set(setup);
};