|
1 | | -// Sample Karma configuration file, that contain pretty much all the available options |
2 | | -// It's used for running client tests on Travis (http://travis-ci.org/#!/karma-runner/karma) |
3 | | -// Most of the options can be overriden by cli arguments (see karma --help) |
4 | | -// |
5 | | -// For all available config options and default values, see: |
6 | | -// https://github.com/karma-runner/karma/blob/stable/lib/config.js#L54 |
7 | | - |
8 | | - |
9 | | -// base path, that will be used to resolve files and exclude |
10 | | -basePath = '../'; |
11 | | - |
12 | | -// list of files / patterns to load in the browser |
13 | | -files = [ |
14 | | - 'conf/mocha.conf.js', |
15 | | - 'node_modules/chai/chai.js', |
16 | | - 'test/*.js', |
17 | | - 'custom-elements.js', |
18 | | - {pattern: 'src/*', included: false}, |
19 | | - {pattern: 'tools/**/*.js', included: false} |
20 | | -]; |
21 | | - |
22 | | -// list of files to exclude |
23 | | -exclude = []; |
24 | | - |
25 | | -frameworks = ['mocha']; |
26 | | - |
27 | | -// use dots reporter, as travis terminal does not support escaping sequences |
28 | | -// possible values: 'dots', 'progress', 'junit', 'teamcity' |
29 | | -// CLI --reporters progress |
30 | | -reporters = ['progress']; |
31 | | - |
32 | | -// web server port |
33 | | -// CLI --port 9876 |
34 | | -port = 9876; |
35 | | - |
36 | | -// cli runner port |
37 | | -// CLI --runner-port 9100 |
38 | | -runnerPort = 9100; |
39 | | - |
40 | | -// enable / disable colors in the output (reporters and logs) |
41 | | -// CLI --colors --no-colors |
42 | | -colors = true; |
43 | | - |
44 | | -// level of logging |
45 | | -// possible values: LOG_DISABLE || LOG_ERROR || LOG_WARN || LOG_INFO || LOG_DEBUG |
46 | | -// CLI --log-level debug |
47 | | -logLevel = LOG_INFO; |
48 | | - |
49 | | -// enable / disable watching file and executing tests whenever any file changes |
50 | | -// CLI --auto-watch --no-auto-watch |
51 | | -autoWatch = true; |
52 | | - |
53 | | -// Start these browsers, currently available: |
54 | | -// - Chrome |
55 | | -// - ChromeCanary |
56 | | -// - Firefox |
57 | | -// - Opera |
58 | | -// - Safari (only Mac) |
59 | | -// - PhantomJS |
60 | | -// - IE (only Windows) |
61 | | -// CLI --browsers Chrome,Firefox,Safari |
62 | | -browsers = ['ChromeCanary']; |
63 | | - |
64 | | -// If browser does not capture in given timeout [ms], kill it |
65 | | -// CLI --capture-timeout 5000 |
66 | | -captureTimeout = 50000; |
67 | | - |
68 | | -// Auto run tests on start (when browsers are captured) and exit |
69 | | -// CLI --single-run --no-single-run |
70 | | -singleRun = true; |
71 | | - |
72 | | -// report which specs are slower than 500ms |
73 | | -// CLI --report-slower-than 500 |
74 | | -reportSlowerThan = 500; |
75 | | - |
76 | | -// compile coffee scripts |
77 | | -preprocessors = { |
| 1 | +module.exports = function(karma) { |
| 2 | + karma.configure({ |
| 3 | + // base path, that will be used to resolve files and exclude |
| 4 | + basePath: '../', |
| 5 | + |
| 6 | + // list of files / patterns to load in the browser |
| 7 | + files: [ |
| 8 | + 'tools/test/mocha-htmltest.js', |
| 9 | + 'conf/mocha.conf.js', |
| 10 | + 'node_modules/chai/chai.js', |
| 11 | + 'custom-elements.js', |
| 12 | + 'test/js/*.js', |
| 13 | + {pattern: 'src/*', included: false}, |
| 14 | + {pattern: 'test/html/*.html', included: false}, |
| 15 | + {pattern: 'tools/**/*.js', included: false} |
| 16 | + ], |
| 17 | + |
| 18 | + // list of files to exclude |
| 19 | + exclude: [], |
| 20 | + |
| 21 | + frameworks: ['mocha'], |
| 22 | + |
| 23 | + // use dots reporter, as travis terminal does not support escaping sequences |
| 24 | + // possible values: 'dots', 'progress', 'junit', 'teamcity' |
| 25 | + // CLI --reporters progress |
| 26 | + reporters: ['progress'], |
| 27 | + |
| 28 | + // web server port |
| 29 | + // CLI --port 9876 |
| 30 | + port: 9876, |
| 31 | + |
| 32 | + // cli runner port |
| 33 | + // CLI --runner-port 9100 |
| 34 | + runnerPort: 9100, |
| 35 | + |
| 36 | + // enable / disable colors in the output (reporters and logs) |
| 37 | + // CLI --colors --no-colors |
| 38 | + colors: true, |
| 39 | + |
| 40 | + // level of logging |
| 41 | + // possible values: LOG_DISABLE || LOG_ERROR || LOG_WARN || LOG_INFO || LOG_DEBUG |
| 42 | + // CLI --log-level debug |
| 43 | + logLevel: karma.LOG_INFO, |
| 44 | + |
| 45 | + // enable / disable watching file and executing tests whenever any file changes |
| 46 | + // CLI --auto-watch --no-auto-watch |
| 47 | + autoWatch: true, |
| 48 | + |
| 49 | + // Start these browsers, currently available: |
| 50 | + // - Chrome |
| 51 | + // - ChromeCanary |
| 52 | + // - Firefox |
| 53 | + // - Opera |
| 54 | + // - Safari (only Mac) |
| 55 | + // - PhantomJS |
| 56 | + // - IE (only Windows) |
| 57 | + // CLI --browsers Chrome,Firefox,Safari |
| 58 | + browsers: ['ChromeCanary'], |
| 59 | + |
| 60 | + // If browser does not capture in given timeout [ms], kill it |
| 61 | + // CLI --capture-timeout 5000 |
| 62 | + captureTimeout: 50000, |
| 63 | + |
| 64 | + // Auto run tests on start (when browsers are captured) and exit |
| 65 | + // CLI --single-run --no-single-run |
| 66 | + singleRun: true, |
| 67 | + |
| 68 | + // report which specs are slower than 500ms |
| 69 | + // CLI --report-slower-than 500 |
| 70 | + reportSlowerThan: 500, |
| 71 | + |
| 72 | + plugins: [ |
| 73 | + 'karma-mocha', |
| 74 | + 'karma-chrome-launcher', |
| 75 | + 'karma-firefox-launcher', |
| 76 | + 'karma-script-launcher', |
| 77 | + 'karma-crbot-reporter' |
| 78 | + ] |
| 79 | + }); |
78 | 80 | }; |
79 | | - |
80 | | -plugins = [ |
81 | | - 'karma-mocha', |
82 | | - 'karma-chrome-launcher', |
83 | | - 'karma-firefox-launcher', |
84 | | - 'karma-script-launcher', |
85 | | - 'karma-crbot-reporter' |
86 | | -] |
0 commit comments