|
1 | | -'use strict'; |
| 1 | +module.exports = function (config) { |
| 2 | + config.set({ |
2 | 3 |
|
3 | | -var path = require('path'); |
4 | | -var conf = require('./gulp/conf'); |
| 4 | + // Base path, that will be used to resolve files and exclude |
| 5 | + basePath: '', |
5 | 6 |
|
6 | | -var _ = require('lodash'); |
7 | | -var wiredep = require('wiredep'); |
| 7 | + // Frameworks to use |
| 8 | + frameworks: ['jasmine'], |
8 | 9 |
|
9 | | -function listFiles() { |
10 | | - var wiredepOptions = _.extend({}, conf.wiredep, { |
11 | | - dependencies: true, |
12 | | - devDependencies: true |
13 | | - }); |
14 | | - |
15 | | - return wiredep(wiredepOptions).js |
16 | | - .concat([ |
17 | | - path.join(conf.paths.src, '/app/**/*.module.js'), |
18 | | - path.join(conf.paths.src, '/app/**/*.js'), |
19 | | - path.join(conf.paths.src, '/**/*.spec.js'), |
20 | | - path.join(conf.paths.src, '/**/*.mock.js'), |
21 | | - path.join(conf.paths.src, '/**/*.html') |
22 | | - ]); |
23 | | -} |
24 | | - |
25 | | -module.exports = function(config) { |
26 | | - |
27 | | - var configuration = { |
28 | | - files: listFiles(), |
29 | | - |
30 | | - singleRun: true, |
| 10 | + // List of files / patterns to load in the browser |
| 11 | + files: [ |
| 12 | + 'bower_components/jquery/dist/jquery.js', |
| 13 | + 'bower_components/angular/angular.js', |
| 14 | + 'bower_components/angular-mocks/angular-mocks.js', |
31 | 15 |
|
32 | | - autoWatch: false, |
33 | | - |
34 | | - frameworks: ['jasmine', 'angular-filesort'], |
| 16 | + 'bower_components/slick-carousel/slick/slick.js', |
| 17 | + 'dist/angular-slick.js', |
| 18 | + 'test/**/*.spec.js' |
| 19 | + ], |
35 | 20 |
|
36 | | - angularFilesort: { |
37 | | - whitelist: [path.join(conf.paths.src, '/**/!(*.html|*.spec|*.mock).js')] |
38 | | - }, |
| 21 | + // List of files to exclude |
| 22 | + exclude: [], |
39 | 23 |
|
40 | | - ngHtml2JsPreprocessor: { |
41 | | - stripPrefix: 'src/', |
42 | | - moduleName: 'angularSlickCarousel' |
43 | | - }, |
| 24 | + // Web server port |
| 25 | + port: 9876, |
44 | 26 |
|
45 | | - browsers : ['PhantomJS'], |
| 27 | + // Level of logging |
| 28 | + // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG |
| 29 | + logLevel: config.LOG_INFO, |
46 | 30 |
|
47 | | - plugins : [ |
48 | | - 'karma-phantomjs-launcher', |
49 | | - 'karma-angular-filesort', |
50 | | - 'karma-jasmine', |
51 | | - 'karma-ng-html2js-preprocessor' |
52 | | - ], |
| 31 | + // Enable / disable watching file and executing tests whenever any file changes |
| 32 | + autoWatch: true, |
53 | 33 |
|
54 | | - preprocessors: { |
55 | | - 'src/**/*.html': ['ng-html2js'] |
56 | | - } |
57 | | - }; |
| 34 | + // Start these browsers, currently available: |
| 35 | + // - Chrome |
| 36 | + // - ChromeCanary |
| 37 | + // - Firefox |
| 38 | + // - Opera |
| 39 | + // - Safari (only Mac) |
| 40 | + // - PhantomJS |
| 41 | + // - IE (only Windows) |
| 42 | + browsers: [process.env.TRAVIS ? 'Firefox' : 'Chrome'], |
58 | 43 |
|
59 | | - // This block is needed to execute Chrome on Travis |
60 | | - // If you ever plan to use Chrome and Travis, you can keep it |
61 | | - // If not, you can safely remove it |
62 | | - // https://github.com/karma-runner/karma/issues/1144#issuecomment-53633076 |
63 | | - if(configuration.browsers[0] === 'Chrome' && process.env.TRAVIS) { |
64 | | - configuration.customLaunchers = { |
65 | | - 'chrome-travis-ci': { |
66 | | - base: 'Chrome', |
67 | | - flags: ['--no-sandbox'] |
68 | | - } |
69 | | - }; |
70 | | - configuration.browsers = ['chrome-travis-ci']; |
71 | | - } |
72 | | - |
73 | | - config.set(configuration); |
| 44 | + // Continuous Integration mode |
| 45 | + // if true, it capture browsers, run tests and exit |
| 46 | + singleRun: false |
| 47 | + }); |
74 | 48 | }; |
0 commit comments