karma_common_requirejs.conf.js 1.16 KB
Newer Older
1
// Karma config for common-requirejs suite.
2
// Docs and troubleshooting tips in common/static/common/js/karma.common.conf.js
3

4
/* eslint-env node */
5 6 7 8 9

'use strict';
var path = require('path');
var configModule = require(path.join(__dirname, '../../common/static/common/js/karma.common.conf.js'));

10 11 12 13
var options = {

    includeCommonFiles: true,

14
    normalizePathsForCoverageFunc: function(appRoot, pattern) {
15 16 17
        return path.join(appRoot, '/common/static/' + pattern);
    },

18
    libraryFiles: [
19 20 21 22
        {pattern: 'coffee/src/**/*.js'},
        {pattern: 'js/libs/**/*.js'},
        {pattern: 'js/test/**/*.js'},
        {pattern: 'js/vendor/**/*.js'}
23
    ],
24

25 26
    // Make sure the patterns in sourceFiles and specFiles do not match the same file.
    // Otherwise Istanbul which is used for coverage tracking will cause tests to not run.
27
    sourceFiles: [],
28

29
    specFiles: [
30
        {pattern: 'common/js/spec/**/*spec.js'}
31
    ],
32

33
    fixtureFiles: [
34
        {pattern: 'common/templates/**/*.*'}
35
    ],
36

37 38
    runFiles: [
        {pattern: 'common/js/spec/main_requirejs.js', included: true}
39 40
    ]
};
Ehtesham committed
41

42
module.exports = function(config) {
43
    configModule.configure(config, options);
44
};