|
2 | 2 | // This assumes you run karma from the root of the repository. |
3 | 3 | // |
4 | 4 |
|
5 | | -// base path, that will be used to resolve files and exclude |
6 | | -basePath = '../../'; |
7 | | - |
8 | | -// Jasmine is our unit test framework. |
9 | | -frameworks = ['jasmine']; |
10 | | - |
11 | | -// list of files / patterns to load in the browser |
12 | | -files = [ |
13 | | - JASMINE, |
14 | | - JASMINE_ADAPTER, |
15 | | - 'src/js/thirdparty/angular.js', |
16 | | - 'src/tests/thirdparty/angular-mocks.js', |
17 | | - 'src/tests/thirdparty/sinon.js', |
18 | | - 'src/js/core.js', |
19 | | - 'src/js/lib/*.js', |
20 | | - 'src/js/directives/*.js', |
21 | | - 'src/tests/*.js', |
22 | | - 'src/tests/lib/*.js', |
23 | | - 'src/tests/directives/*.js', |
24 | | - { pattern: 'src/tests/directives/*.html', included: false, served: true }, |
25 | | - { pattern: 'src/tests/lib/*.html', included: false, served: true }, |
26 | | - { pattern: 'src/tests/thirdparty/jasmine/*.js', included: false, served: true }, |
27 | | - { pattern: 'src/tests/thirdparty/jasmine/*.css', included: false, served: true }, |
28 | | -]; |
29 | | - |
30 | | -// Tell the http server to sever all files from http://localhost:9876/src/ |
31 | | -proxies = { |
32 | | - '/src/': 'http://localhost:9876/base/src/', |
33 | | -}; |
34 | | - |
35 | | -// list of files to exclude |
36 | | -exclude = [ |
37 | | -]; |
38 | | - |
39 | | -// test results reporter to use |
40 | | -// possible values: 'dots', 'progress', 'junit' |
41 | | -reporters = ['progress']; |
42 | | - |
43 | | - |
44 | | -// web server port |
45 | | -port = 9876; |
46 | | - |
47 | | - |
48 | | -// cli runner port |
49 | | -runnerPort = 9100; |
50 | | - |
51 | | -// enable / disable colors in the output (reporters and logs) |
52 | | -colors = true; |
53 | | - |
54 | | -// level of logging |
55 | | -// possible values: LOG_DISABLE || LOG_ERROR || LOG_WARN || LOG_INFO || LOG_DEBUG |
56 | | -logLevel = LOG_INFO; |
57 | | - |
58 | | -// enable / disable watching file and executing tests whenever any file changes |
59 | | -autoWatch = true; |
60 | | - |
61 | | -// Start these browsers, currently available: |
62 | | -// - Chrome |
63 | | -// - ChromeCanary |
64 | | -// - Firefox |
65 | | -// - Opera |
66 | | -// - Safari (only Mac) |
67 | | -// - PhantomJS |
68 | | -// - IE (only Windows) |
69 | | -browsers = ['Chrome']; |
70 | | - |
71 | | - |
72 | | -// If browser does not capture in given timeout [ms], kill it |
73 | | -captureTimeout = 60000; |
74 | | - |
75 | | -// Continuous Integration mode |
76 | | -// if true, it capture browsers, run tests and exit |
77 | | -singleRun = false; |
78 | | - |
79 | | -plugins = [ |
80 | | - 'karma-jasmine', |
81 | | - 'karma-chrome-launcher', |
82 | | -]; |
| 5 | +module.exports = function(config) { |
| 6 | + config.set({ |
| 7 | + // base path, that will be used to resolve files and exclude |
| 8 | + basePath: '../../', |
| 9 | + |
| 10 | + // Jasmine is our unit test framework. |
| 11 | + frameworks: ['jasmine'], |
| 12 | + |
| 13 | + // list of files / patterns to load in the browser |
| 14 | + files: [ |
| 15 | + 'src/js/thirdparty/angular.js', |
| 16 | + 'src/tests/thirdparty/angular-mocks.js', |
| 17 | + 'src/tests/thirdparty/sinon.js', |
| 18 | + 'src/js/core.js', |
| 19 | + 'src/js/lib/*.js', |
| 20 | + 'src/js/directives/*.js', |
| 21 | + 'src/tests/*.js', |
| 22 | + 'src/tests/lib/*.js', |
| 23 | + 'src/tests/directives/*.js', |
| 24 | + { pattern: 'src/tests/directives/*.html', included: false, served: true }, |
| 25 | + { pattern: 'src/tests/lib/*.html', included: false, served: true }, |
| 26 | + { pattern: 'src/tests/thirdparty/jasmine/*.js', included: false, served: true }, |
| 27 | + { pattern: 'src/tests/thirdparty/jasmine/*.css', included: false, served: true }, |
| 28 | + ], |
| 29 | + |
| 30 | + // Tell the http server to sever all files from http://localhost:9876/src/ |
| 31 | + proxies: { |
| 32 | + '/src/': 'http://localhost:9876/base/src/', |
| 33 | + }, |
| 34 | + |
| 35 | + // list of files to exclude |
| 36 | + exclude: [ |
| 37 | + ], |
| 38 | + |
| 39 | + // test results reporter to use |
| 40 | + // possible values: 'dots', 'progress', 'junit' |
| 41 | + reporters: ['progress'], |
| 42 | + |
| 43 | + |
| 44 | + // web server port |
| 45 | + port: 9876, |
| 46 | + |
| 47 | + |
| 48 | + // cli runner port |
| 49 | + runnerPort: 9100, |
| 50 | + |
| 51 | + // enable / disable colors in the output (reporters and logs) |
| 52 | + colors: true, |
| 53 | + |
| 54 | + // level of logging |
| 55 | + // possible values: LOG_DISABLE || LOG_ERROR || LOG_WARN || LOG_INFO || LOG_DEBUG |
| 56 | + logLevel: config.LOG_INFO, |
| 57 | + |
| 58 | + // enable / disable watching file and executing tests whenever any file changes |
| 59 | + autoWatch: true, |
| 60 | + |
| 61 | + // Start these browsers, currently available: |
| 62 | + // - Chrome |
| 63 | + // - ChromeCanary |
| 64 | + // - Firefox |
| 65 | + // - Opera |
| 66 | + // - Safari (only Mac) |
| 67 | + // - PhantomJS |
| 68 | + // - IE (only Windows) |
| 69 | + browsers: ['Chrome'], |
| 70 | + |
| 71 | + |
| 72 | + // If browser does not capture in given timeout [ms], kill it |
| 73 | + captureTimeout: 60000, |
| 74 | + |
| 75 | + // Continuous Integration mode |
| 76 | + // if true, it capture browsers, run tests and exit |
| 77 | + singleRun: false, |
| 78 | + |
| 79 | + plugins: [ |
| 80 | + 'karma-jasmine', |
| 81 | + 'karma-chrome-launcher', |
| 82 | + ], |
| 83 | + }); |
| 84 | +} |
83 | 85 |
|
0 commit comments