| Total Complexity | 3 |
| Complexity/F | 3 |
| Lines of Code | 69 |
| Function Count | 1 |
| Duplicated Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | // Karma configuration |
||
| 3 | var isTravis = (process.env.TRAVIS_BUILD_NUMBER) ? true : false; |
||
| 4 | var browsers = ['Firefox']; |
||
| 5 | if(!isTravis){ |
||
| 6 | browsers = ['Chrome']; |
||
| 7 | } |
||
| 8 | module.exports = function (config) { |
||
| 9 | config.set({ |
||
| 10 | |||
| 11 | // base path that will be used to resolve all patterns (eg. files, exclude) |
||
| 12 | basePath: '.', |
||
| 13 | |||
| 14 | |||
| 15 | // frameworks to use |
||
| 16 | // available frameworks: https://npmjs.org/browse/keyword/karma-adapter |
||
| 17 | frameworks: ['jasmine'], |
||
| 18 | |||
| 19 | |||
| 20 | // list of files / patterns to load in the browser |
||
| 21 | files: [ |
||
| 22 | 'js/lib/data/tlds.js', |
||
| 23 | 'js/lib/parseTLD.js', |
||
| 24 | 'js/lib/parseUrl.js', |
||
| 25 | { pattern: 'tests/**/*.js', included: true } |
||
| 26 | ], |
||
| 27 | |||
| 28 | |||
| 29 | // list of files to exclude |
||
| 30 | exclude: [ |
||
| 31 | ], |
||
| 32 | |||
| 33 | |||
| 34 | // preprocess matching files before serving them to the browser |
||
| 35 | // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor |
||
| 36 | preprocessors: {}, |
||
| 37 | |||
| 38 | |||
| 39 | // test results reporter to use |
||
| 40 | // possible values: 'dots', 'progress' |
||
| 41 | // available reporters: https://npmjs.org/browse/keyword/karma-reporter |
||
| 42 | reporters: ['verbose'], |
||
| 43 | |||
| 44 | |||
| 45 | // web server port |
||
| 46 | port: 9876, |
||
| 47 | |||
| 48 | |||
| 49 | // enable / disable colors in the output (reporters and logs) |
||
| 50 | colors: true, |
||
| 51 | |||
| 52 | |||
| 53 | // level of logging |
||
| 54 | // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG |
||
| 55 | logLevel: config.LOG_INFO, |
||
| 56 | |||
| 57 | |||
| 58 | // enable / disable watching file and executing tests whenever any file changes |
||
| 59 | autoWatch: false, |
||
| 60 | |||
| 61 | |||
| 62 | // start these browsers |
||
| 63 | // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher |
||
| 64 | browsers: browsers, |
||
| 65 | |||
| 66 | |||
| 67 | // Continuous Integration mode |
||
| 68 | // if true, Karma captures browsers, runs the tests and exits |
||
| 69 | singleRun: true |
||
| 70 | }); |
||
| 71 | }; |