aboutsummaryrefslogtreecommitdiffstats
path: root/karma.conf.js
blob: bc35fb7d4211da9728decb777bc9e5c89a61d656 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/****************************************************************************************
 * Karma configuration file
 ***************************************************************************************/

module.exports = function (config) {
    config.set({
        basePath:'',
        files:[
            'karma.entry.js',
        ],

        /**
         * Enable / disable watching file and executing tests whenever any file changes
         */
        autoWatch: true,

        /**
         * Here, we tell Karma we'll be using Jasmine
         */
        frameworks:['jasmine'],

        /**
         * Level of logging
         * possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
         */
        logLevel: config.LOG_INFO,

        /**
         * Currently we have the following launchers: Firefox, Chrome, PhantomJS
         * Available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
         */
        browsers: ['Firefox', 'PhantomJS'],

        /**
         * Tells PhantomJS to shut down if Karma throws a ResourceError, If we didn't, PhantomJS might not shut down,
         * and this would eat away at our system resources.
         */
        phantomJsLauncher: {
            exitOnResourceError: true
        },

        /**
         * We tell Karma to run a list of preprocessors on our karma.entry.js file
         */
        preprocessors: {
            'karma.entry.js': ['webpack', 'sourcemap']
        },


        /**
         *  dots: Tells karma to use dots reporter, which outputs a single dot for each test instead of descriptive message.
         *  kjhtml - Karma Jasmine HTML Reporter. Reporter that dynamically shows tests results at debug.html page.
         */
        reporters: ['dots', 'kjhtml'],

        /**
         * leave Jasmine Spec Runner output visible in browser
         */
        client: {
            clearContext: false
        },

        /**
         * Keeps karma running after it completed it's tests for later rerun.
         */
        singleRun: false,

        failOnEmptyTestSuite:false,

        /**
         * Load webpack test configuration file
         */
        webpack: require('./webpack/webpack.test.js'),

        webpackMiddleware: {
          noInfo: true
        },

        /**
         * Hide webpack bundle information messages
         */
        webpackServer: {
            noInfo: true
        }
    })
};