karma_common.conf.js 3.36 KB
Newer Older
1
// Karma config for common suite.
2
// Docs and troubleshooting tips in common/static/common/js/karma.common.conf.js
3 4 5 6 7 8 9

/* jshint node: true */
/*jshint -W079 */
'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 = {

    useRequireJs: false,

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

18
    // Avoid adding files to this list. Use RequireJS.
19 20 21
    libraryFilesToInclude: [
        {pattern: 'coffee/src/ajax_prefix.js', included: true},
        {pattern: 'js/vendor/draggabilly.js', included: true},
22 23
        {pattern: 'common/js/vendor/jquery.js', included: true},
        {pattern: 'common/js/vendor/jquery-migrate.js', included: true},
24 25 26
        {pattern: 'coffee/src/jquery.immediateDescendents.js', included: true},
        {pattern: 'js/vendor/jquery.leanModal.js', included: true},
        {pattern: 'js/vendor/jquery.timeago.js', included: true},
27 28 29 30 31
        {pattern: 'js/vendor/jquery.truncate.js', included: true},
        {pattern: 'js/vendor/mustache.js', included: true},
        {pattern: 'js/vendor/URI.min.js', included: true},
        {pattern: 'js/test/add_ajax_prefix.js', included: true},
        {pattern: 'js/test/i18n.js', included: true},
32 33 34 35 36

        {pattern: 'common/js/vendor/underscore.js', included: true},
        {pattern: 'common/js/vendor/underscore.string.js', included: true},
        {pattern: 'common/js/vendor/backbone.js', included: true},

37 38 39
        {pattern: 'edx-ui-toolkit/js/utils/global-loader.js', included: true},
        {pattern: 'edx-pattern-library/js/modernizr-custom.js', included: true},
        {pattern: 'edx-pattern-library/js/afontgarde.js', included: true},
40 41 42
        {pattern: 'edx-pattern-library/js/edx-icons.js', included: true},

        {pattern: 'js/vendor/jasmine-imagediff.js', included: true},
43
        {pattern: 'common/js/spec_helpers/jasmine-extensions.js', included: true},
44 45 46
        {pattern: 'common/js/spec_helpers/jasmine-waituntil.js', included: true},
        {pattern: 'common/js/spec_helpers/discussion_spec_helper.js', included: true},
        {pattern: 'common/js/spec/discussion/view/discussion_view_spec_helper.js', included: true}
47 48 49
    ],

    libraryFiles: [
50
    ],
51

52 53
    // 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.
54
    sourceFiles: [
55
        {pattern: 'coffee/src/**/*.js', included: true},
56 57
        {pattern: 'common/js/xblock/core.js', included: true},
        {pattern: 'common/js/xblock/runtime.v1.js', included: true},
58
        {pattern: 'common/js/discussion/**/*.js', included: true},
59 60
        {pattern: 'js/capa/src/**/*.js', included: true},
        {pattern: 'js/src/**/*.js', included: true}
61
    ],
62

63
    specFiles: [
64
        {pattern: 'coffee/spec/**/*.js', included: true},
65
        {pattern: 'common/js/spec/xblock/*.js', included: true},
66
        {pattern: 'common/js/spec/discussion/**/*spec.js', included: true},
67
        {pattern: 'js/**/*spec.js', included: true}
68
    ],
69

70
    fixtureFiles: [
71 72 73
        {pattern: 'js/fixtures/**/*.html'},
        {pattern: 'js/capa/fixtures/**/*.html'},
        {pattern: 'common/templates/**/*.underscore'}
74 75
    ]
};
Ehtesham committed
76

77
module.exports = function(config) {
78
    configModule.configure(config, options);
79
};