Matteo Scandolo | 23254d1 | 2016-04-20 16:50:29 -0700 | [diff] [blame] | 1 | // Karma configuration |
| 2 | // Generated on Tue Oct 06 2015 09:27:10 GMT+0000 (UTC) |
| 3 | |
| 4 | /* eslint indent: [2,2], quotes: [2, "single"]*/ |
| 5 | |
Matteo Scandolo | cd1aceb | 2016-04-20 17:06:27 -0700 | [diff] [blame] | 6 | // CONFIGURATION FOR JENKINS TESTS |
| 7 | |
Matteo Scandolo | 23254d1 | 2016-04-20 16:50:29 -0700 | [diff] [blame] | 8 | /*eslint-disable*/ |
| 9 | var wiredep = require('wiredep'); |
| 10 | var path = require('path'); |
| 11 | |
| 12 | var bowerComponents = wiredep({devDependencies: true})[ 'js' ].map(function( file ){ |
| 13 | return path.relative(process.cwd(), file); |
| 14 | }); |
| 15 | |
| 16 | var files = bowerComponents.concat([ |
| 17 | 'node_modules/babel-polyfill/dist/polyfill.js', |
Matteo Scandolo | c11285d | 2016-04-26 10:12:25 -0700 | [diff] [blame] | 18 | '../../xos/core/xoslib/static/js/vendor/ngXosHelpers.js', |
Matteo Scandolo | 23254d1 | 2016-04-20 16:50:29 -0700 | [diff] [blame] | 19 | 'xosHelpers/spec/**/*.test.js' |
| 20 | ]); |
| 21 | |
| 22 | module.exports = function(config) { |
| 23 | /*eslint-enable*/ |
| 24 | config.set({ |
| 25 | |
| 26 | // base path that will be used to resolve all patterns (eg. files, exclude) |
| 27 | basePath: '', |
| 28 | |
| 29 | |
| 30 | // frameworks to use |
| 31 | // available frameworks: https://npmjs.org/browse/keyword/karma-adapter |
| 32 | frameworks: ['jasmine'], |
| 33 | |
| 34 | |
| 35 | // list of files / patterns to load in the browser |
| 36 | files: files, |
| 37 | |
| 38 | |
| 39 | // list of files to exclude |
| 40 | exclude: [ |
| 41 | ], |
| 42 | |
| 43 | |
| 44 | // preprocess matching files before serving them to the browser |
| 45 | // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor |
| 46 | preprocessors: { |
| 47 | 'xosHelpers/**/*.js': ['babel', 'coverage'], |
| 48 | }, |
| 49 | |
| 50 | babelPreprocessor: { |
| 51 | options: { |
| 52 | presets: ['es2015'], |
| 53 | sourceMap: 'inline' |
| 54 | }, |
| 55 | filename: function (file) { |
| 56 | return file.originalPath; |
| 57 | }, |
| 58 | }, |
| 59 | |
| 60 | //ngHtml2JsPreprocessor: { |
| 61 | // stripPrefix: 'src/', //strip the src path from template url (http://stackoverflow.com/questions/22869668/karma-unexpected-request-when-testing-angular-directive-even-with-ng-html2js) |
| 62 | // moduleName: 'templates' // define the template module name |
| 63 | //}, |
| 64 | |
| 65 | // test results reporter to use |
| 66 | // possible values: 'dots', 'progress' |
| 67 | // available reporters: https://npmjs.org/browse/keyword/karma-reporter |
| 68 | reporters: ['dots', 'junit', 'coverage'], |
| 69 | |
| 70 | junitReporter: { |
| 71 | outputDir: 'test-result', |
Matteo Scandolo | 3fa32c6 | 2016-04-20 17:00:01 -0700 | [diff] [blame] | 72 | useBrowserName: false, |
Matteo Scandolo | 23254d1 | 2016-04-20 16:50:29 -0700 | [diff] [blame] | 73 | outputFile: 'test-results.xml' |
| 74 | }, |
| 75 | |
| 76 | coverageReporter: { |
Matteo Scandolo | 3fa32c6 | 2016-04-20 17:00:01 -0700 | [diff] [blame] | 77 | type: 'cobertura', |
| 78 | subdir: '.', |
| 79 | dir: 'test-result/' |
Matteo Scandolo | 23254d1 | 2016-04-20 16:50:29 -0700 | [diff] [blame] | 80 | }, |
| 81 | |
| 82 | // web server port |
| 83 | port: 9876, |
| 84 | |
| 85 | |
| 86 | // enable / disable colors in the output (reporters and logs) |
| 87 | colors: true, |
| 88 | |
| 89 | |
| 90 | // level of logging |
| 91 | // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG |
| 92 | logLevel: config.LOG_ERROR, |
| 93 | |
| 94 | |
| 95 | // enable / disable watching file and executing tests whenever any file changes |
| 96 | autoWatch: false, |
| 97 | |
| 98 | |
| 99 | // start these browsers |
| 100 | // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher |
| 101 | browsers: ['PhantomJS'], |
| 102 | |
| 103 | |
| 104 | // Continuous Integration mode |
| 105 | // if true, Karma captures browsers, runs the tests and exits |
| 106 | singleRun: true |
| 107 | }); |
| 108 | }; |