diff --git a/cms/static/karma_cms.conf.js b/cms/static/karma_cms.conf.js index 6e4a645a5c..69fb07ab26 100644 --- a/cms/static/karma_cms.conf.js +++ b/cms/static/karma_cms.conf.js @@ -8,74 +8,38 @@ var path = require('path'); var configModule = require(path.join(__dirname, '../../common/static/common/js/karma.common.conf.js')); var files = { + libraryFilesToInclude: [ + {pattern: 'xmodule_js/common_static/js/libs/jasmine-extensions.js', included: true} + ], + libraryFiles: [ - {pattern: 'xmodule_js/common_static/coffee/src/ajax_prefix.js'}, - {pattern: 'xmodule_js/common_static/js/src/utility.js'}, - {pattern: 'xmodule_js/common_static/js/vendor/jquery.min.js'}, - {pattern: 'xmodule_js/common_static/js/vendor/jquery-ui.min.js'}, - {pattern: 'xmodule_js/common_static/js/vendor/jquery.cookie.js'}, - {pattern: 'xmodule_js/common_static/js/vendor/jquery.simulate.js'}, - {pattern: 'xmodule_js/common_static/common/js/vendor/underscore.js'}, - {pattern: 'xmodule_js/common_static/common/js/vendor/underscore.string.js'}, - {pattern: 'xmodule_js/common_static/common/js/vendor/backbone.js'}, - {pattern: 'xmodule_js/common_static/js/vendor/backbone-associations-min.js'}, - {pattern: 'xmodule_js/common_static/js/vendor/backbone.paginator.min.js'}, - {pattern: 'xmodule_js/common_static/js/vendor/backbone-relational.min.js'}, - {pattern: 'xmodule_js/common_static/js/vendor/timepicker/jquery.timepicker.js'}, - {pattern: 'xmodule_js/common_static/js/vendor/jquery.leanModal.js'}, - {pattern: 'xmodule_js/common_static/js/vendor/jquery.ajaxQueue.js'}, - {pattern: 'xmodule_js/common_static/js/vendor/jquery.form.js'}, - {pattern: 'xmodule_js/common_static/js/vendor/html5-input-polyfills/number-polyfill.js'}, - {pattern: 'xmodule_js/common_static/js/vendor/sinon-1.17.0.js'}, - {pattern: 'xmodule_js/common_static/js/vendor/Squire.js'}, - {pattern: 'xmodule_js/common_static/js/libs/jasmine-stealth.js'}, - {pattern: 'xmodule_js/common_static/js/libs/jasmine-waituntil.js'}, - {pattern: 'xmodule_js/common_static/js/libs/jasmine-extensions.js', included: true}, - {pattern: 'xmodule_js/common_static/js/vendor/jasmine-imagediff.js'}, - {pattern: 'xmodule_js/common_static/js/vendor/CodeMirror/codemirror.js'}, - {pattern: 'xmodule_js/common_static/js/vendor/jQuery-File-Upload/js/**/*.js'}, - {pattern: 'xmodule_js/src/xmodule.js'}, - {pattern: 'xmodule_js/common_static/js/test/i18n.js'}, - {pattern: 'xmodule_js/common_static/js/vendor/draggabilly.js'}, - {pattern: 'xmodule_js/common_static/js/vendor/date.js'}, - {pattern: 'xmodule_js/common_static/js/vendor/domReady.js'}, - {pattern: 'xmodule_js/common_static/js/vendor/URI.min.js'}, - {pattern: 'xmodule_js/common_static/js/vendor/jquery.smooth-scroll.min.js'}, - {pattern: 'xmodule_js/common_static/coffee/src/jquery.immediateDescendents.js'}, - {pattern: 'xmodule_js/common_static/js/xblock/**/*.js'}, - {pattern: 'xmodule_js/common_static/coffee/src/xblock/**/*.js'}, - {pattern: 'xmodule_js/common_static/js/vendor/jQuery-File-Upload/js/jquery.iframe-transport.js'}, - {pattern: 'xmodule_js/common_static/js/vendor/jQuery-File-Upload/js/jquery.fileupload.js'}, - {pattern: 'xmodule_js/common_static/js/vendor/jQuery-File-Upload/js/jquery.fileupload-process.js'}, - {pattern: 'xmodule_js/common_static/js/vendor/jQuery-File-Upload/js/jquery.fileupload-validate.js'}, - {pattern: 'xmodule_js/common_static/js/vendor/mock-ajax.js'}, - {pattern: 'xmodule_js/common_static/js/vendor/requirejs/text.js'}, - {pattern: 'edx-ui-toolkit/js/utils/global-loader.js'}, - {pattern: 'edx-pattern-library/js/modernizr-custom.js'}, - {pattern: 'edx-pattern-library/js/afontgarde.js'}, - {pattern: 'edx-pattern-library/js/edx-icons.js'}, {pattern: 'edx-pattern-library/js/**/*.js'}, {pattern: 'edx-ui-toolkit/js/**/*.js'}, + {pattern: 'xmodule_js/common_static/coffee/src/**/*.js'}, + {pattern: 'xmodule_js/common_static/common/js/vendor/**/*.js'}, + {pattern: 'xmodule_js/common_static/js/**/*.js'}, + {pattern: 'xmodule_js/src/xmodule.js'}, - {pattern: 'common/js/utils/require-serial.js', included: true} + {pattern: 'xmodule_js/common_static/js/libs/jasmine-stealth.js'}, + {pattern: 'xmodule_js/common_static/js/libs/jasmine-waituntil.js'} ], sourceFiles: [ {pattern: 'coffee/src/**/!(*spec).js'}, - {pattern: 'js/**/!(*spec).js'}, - {pattern: 'common/js/**/!(*spec).js'} + {pattern: 'common/js/**/!(*spec).js'}, + {pattern: 'js/**/!(*spec).js'} ], specFiles: [ {pattern: 'coffee/spec/**/*spec.js'}, - {pattern: 'js/spec/**/*spec.js'}, - {pattern: 'js/certificates/spec/**/*spec.js'} + {pattern: 'js/certificates/spec/**/*spec.js'}, + {pattern: 'js/spec/**/*spec.js'} ], fixtureFiles: [ {pattern: 'coffee/fixtures/**/*.underscore'}, - {pattern: 'templates/**/*.underscore'}, - {pattern: 'common/templates/**/*.underscore'} + {pattern: 'common/templates/**/*.underscore'}, + {pattern: 'templates/**/*.underscore'} ], runFiles: [ diff --git a/cms/static/karma_cms_squire.conf.js b/cms/static/karma_cms_squire.conf.js index e72bdf2025..568660117f 100644 --- a/cms/static/karma_cms_squire.conf.js +++ b/cms/static/karma_cms_squire.conf.js @@ -8,61 +8,34 @@ var path = require('path'); var configModule = require(path.join(__dirname, '../../common/static/common/js/karma.common.conf.js')); var files = { + libraryFilesToInclude: [ + {pattern: 'xmodule_js/common_static/js/libs/jasmine-extensions.js', included: true} + ], + libraryFiles: [ - {pattern: 'xmodule_js/common_static/js/vendor/requirejs/require.js'}, - {pattern: 'xmodule_js/common_static/coffee/src/ajax_prefix.js'}, - {pattern: 'xmodule_js/common_static/js/src/utility.js'}, - {pattern: 'xmodule_js/common_static/js/vendor/jquery.min.js'}, - {pattern: 'xmodule_js/common_static/js/vendor/jquery-ui.min.js'}, - {pattern: 'xmodule_js/common_static/js/vendor/jquery.cookie.js'}, - {pattern: 'xmodule_js/common_static/common/js/vendor/underscore.js'}, - {pattern: 'xmodule_js/common_static/common/js/vendor/underscore.string.js'}, - {pattern: 'xmodule_js/common_static/common/js/vendor/backbone.js'}, - {pattern: 'xmodule_js/common_static/js/vendor/backbone-associations-min.js'}, - {pattern: 'xmodule_js/common_static/js/vendor/backbone.paginator.min.js'}, - {pattern: 'xmodule_js/common_static/js/vendor/timepicker/jquery.timepicker.js'}, - {pattern: 'xmodule_js/common_static/js/vendor/jquery.leanModal.js'}, - {pattern: 'xmodule_js/common_static/js/vendor/jquery.form.js'}, - {pattern: 'xmodule_js/common_static/js/vendor/html5-input-polyfills/number-polyfill.js'}, - {pattern: 'xmodule_js/common_static/js/vendor/sinon-1.17.0.js'}, - {pattern: 'xmodule_js/common_static/js/vendor/Squire.js'}, - {pattern: 'xmodule_js/common_static/js/vendor/jasmine-imagediff.js'}, - {pattern: 'xmodule_js/common_static/js/vendor/CodeMirror/codemirror.js'}, - {pattern: 'xmodule_js/common_static/js/vendor/domReady.js'}, - {pattern: 'xmodule_js/common_static/js/vendor/URI.min.js'}, - {pattern: 'xmodule_js/common_static/js/libs/jasmine-extensions.js', included: true}, - {pattern: 'xmodule_js/src/xmodule.js'}, - {pattern: 'xmodule_js/common_static/coffee/src/jquery.immediateDescendents.js'}, - {pattern: 'xmodule_js/common_static/js/test/i18n.js'}, - {pattern: 'xmodule_js/common_static/js/xblock/**/*.js'}, - {pattern: 'xmodule_js/common_static/coffee/src/xblock/**/*.js'}, - {pattern: 'xmodule_js/common_static/js/vendor/URI.min.js'}, - {pattern: 'xmodule_js/common_static/js/vendor/jQuery-File-Upload/js/jquery.iframe-transport.js'}, - {pattern: 'xmodule_js/common_static/js/vendor/jQuery-File-Upload/js/jquery.fileupload.js'}, - {pattern: 'xmodule_js/common_static/js/vendor/jQuery-File-Upload/js/jquery.fileupload-process.js'}, - {pattern: 'xmodule_js/common_static/js/vendor/jQuery-File-Upload/js/jquery.fileupload-validate.js'}, - {pattern: 'xmodule_js/common_static/js/vendor/requirejs/text.js'}, - {pattern: 'common/js/utils/require-serial.js', included: true} + {pattern: 'edx-pattern-library/js/**/*.js'}, + {pattern: 'edx-ui-toolkit/js/**/*.js'}, + {pattern: 'xmodule_js/common_static/coffee/src/**/*.js'}, + {pattern: 'xmodule_js/common_static/common/js/vendor/**/*.js'}, + {pattern: 'xmodule_js/common_static/js/**/*.js'}, + {pattern: 'xmodule_js/src/**/*.js'}, ], sourceFiles: [ - {pattern: 'coffee/src/**/*.js'}, - {pattern: 'js/collections/**/*.js'}, - {pattern: 'js/models/**/*.js'}, - {pattern: 'js/utils/**/*.js'}, - {pattern: 'js/views/**/*.js'}, - {pattern: 'common/js/**/*.js'} + {pattern: 'coffee/src/**/!(*spec).js'}, + {pattern: 'common/js/**/!(*spec).js'}, + {pattern: 'js/**/!(*spec).js'} ], specFiles: [ - {pattern: 'coffee/spec/**/*.js'}, - {pattern: 'js/spec/**/*.js'} + {pattern: 'coffee/spec/**/*spec.js'}, + {pattern: 'js/spec/**/*spec.js'} ], fixtureFiles: [ {pattern: 'coffee/fixtures/**/*.*'}, - {pattern: 'templates/**/*.*'}, - {pattern: 'common/templates/**/*.*'} + {pattern: 'common/templates/**/*.*'}, + {pattern: 'templates/**/*.*'} ], runFiles: [ diff --git a/common/lib/xmodule/xmodule/js/karma_xmodule.conf.js b/common/lib/xmodule/xmodule/js/karma_xmodule.conf.js index ad3ea0dd19..cf010e0b9c 100644 --- a/common/lib/xmodule/xmodule/js/karma_xmodule.conf.js +++ b/common/lib/xmodule/xmodule/js/karma_xmodule.conf.js @@ -9,49 +9,52 @@ var path = require('path'); var configModule = require(path.join(__dirname, 'common_static/common/js/karma.common.conf.js')); var files = { - libraryFiles: [ - {pattern: 'common_static/js/vendor/jquery.min.js', included: true}, - {pattern: 'common_static/js/test/i18n.js', included: true}, + libraryFilesToInclude: [ + {pattern: 'common_static/js/vendor/requirejs/require.js', included: true}, + {pattern: 'RequireJS-namespace-undefine.js', included: true}, + {pattern: 'spec/main_requirejs.js', included: true}, + {pattern: 'common_static/coffee/src/ajax_prefix.js', included: true}, + {pattern: 'common_static/common/js/vendor/underscore.js', included: true}, + {pattern: 'common_static/common/js/vendor/backbone.js', included: true}, + {pattern: 'common_static/edx-ui-toolkit/js/utils/global-loader.js', included: true}, + {pattern: 'common_static/js/vendor/CodeMirror/codemirror.js', included: true}, + {pattern: 'common_static/js/vendor/draggabilly.js'}, + {pattern: 'common_static/js/vendor/jquery.min.js', included: true}, + {pattern: 'common_static/js/vendor/jquery.cookie.js', included: true}, + {pattern: 'common_static/js/vendor/jquery.leanModal.js', included: true}, + {pattern: 'common_static/js/vendor/jquery.timeago.js', included: true}, + {pattern: 'common_static/js/vendor/jquery-ui.min.js', included: true}, + {pattern: 'common_static/js/vendor/jquery.ui.draggable.js', included: true}, + {pattern: 'common_static/js/vendor/json2.js', included: true}, + {pattern: 'common_static/js/vendor/moment.min.js', included: true}, + {pattern: 'common_static/js/vendor/tinymce/js/tinymce/jquery.tinymce.min.js', included: true}, + {pattern: 'common_static/js/vendor/tinymce/js/tinymce/tinymce.full.min.js', included: true}, + {pattern: 'common_static/js/src/accessibility_tools.js', included: true}, {pattern: 'common_static/js/src/logger.js', included: true}, + {pattern: 'common_static/js/src/utility.js', included: true}, + {pattern: 'common_static/js/test/add_ajax_prefix.js', included: true}, + {pattern: 'common_static/js/test/i18n.js', included: true}, + {pattern: 'public/js/split_test_staff.js', included: true}, + {pattern: 'src/word_cloud/d3.min.js', included: true}, + {pattern: 'common_static/js/vendor/jasmine-imagediff.js', included: true}, {pattern: 'common_static/js/libs/jasmine-waituntil.js', included: true}, {pattern: 'common_static/js/libs/jasmine-extensions.js', included: true}, - {pattern: 'common_static/js/vendor/requirejs/require.js', included: true}, - {pattern: 'RequireJS-namespace-undefine.js', included: true}, - {pattern: 'common_static/js/vendor/jquery-ui.min.js', included: true}, - {pattern: 'common_static/js/vendor/jquery.ui.draggable.js', included: true}, - {pattern: 'common_static/js/vendor/jquery.cookie.js', included: true}, - {pattern: 'common_static/js/vendor/json2.js', included: true}, - {pattern: 'common_static/common/js/vendor/underscore.js', included: true}, - {pattern: 'common_static/common/js/vendor/backbone.js', included: true}, - {pattern: 'common_static/js/vendor/jquery.leanModal.js', included: true}, - {pattern: 'common_static/js/vendor/CodeMirror/codemirror.js', included: true}, - {pattern: 'common_static/js/vendor/tinymce/js/tinymce/jquery.tinymce.min.js', included: true}, - {pattern: 'common_static/js/vendor/tinymce/js/tinymce/tinymce.full.min.js', included: true}, - {pattern: 'common_static/js/vendor/jquery.timeago.js', included: true}, - {pattern: 'common_static/js/vendor/sinon-1.17.0.js', included: true}, - {pattern: 'common_static/js/test/add_ajax_prefix.js', included: true}, - {pattern: 'common_static/js/src/utility.js', included: true}, - {pattern: 'public/js/split_test_staff.js', included: true}, - {pattern: 'common_static/js/src/accessibility_tools.js', included: true}, - {pattern: 'common_static/js/vendor/moment.min.js', included: true}, - {pattern: 'spec/main_requirejs.js', included: true}, - {pattern: 'src/word_cloud/d3.min.js', included: true}, - {pattern: 'common_static/js/vendor/draggabilly.js'}, - {pattern: 'common_static/edx-ui-toolkit/js/utils/global-loader.js', included: true}, - {pattern: 'common_static/edx-pattern-library/js/modernizr-custom.js'}, - {pattern: 'common_static/edx-pattern-library/js/afontgarde.js'}, - {pattern: 'common_static/edx-pattern-library/js/edx-icons.js'} + {pattern: 'common_static/js/vendor/sinon-1.17.0.js', included: true} + ], + + libraryFiles: [ + {pattern: 'common_static/edx-pattern-library/js/**/*.js'} ], sourceFiles: [ - {pattern: 'src/xmodule.js', included: true, ignoreCoverage: true}, + {pattern: 'src/xmodule.js', included: true, ignoreCoverage: true}, // To prevent getting instrumented twice. {pattern: 'src/**/*.js', included: true} ], specFiles: [ - {pattern: 'spec/helper.js', included: true, ignoreCoverage: true}, + {pattern: 'spec/helper.js', included: true, ignoreCoverage: true}, // Helper which depends on source files. {pattern: 'spec/**/*.js', included: true} ], diff --git a/common/static/common/js/karma.common.conf.js b/common/static/common/js/karma.common.conf.js index a279652e5b..16e67006de 100644 --- a/common/static/common/js/karma.common.conf.js +++ b/common/static/common/js/karma.common.conf.js @@ -178,7 +178,6 @@ var setDefaults = function (files) { }; var getBaseConfig = function (config, useRequireJs) { - useRequireJs = useRequireJs === undefined ? true : useRequireJs; var getFrameworkFiles = function () { var files = [ @@ -292,11 +291,12 @@ var getBaseConfig = function (config, useRequireJs) { }; var configure = function(data) { - var baseConfig = getBaseConfig(data.config, data.useRequireJs); + var useRequireJs = data.useRequireJs === undefined ? true : useRequireJs, + baseConfig = getBaseConfig(data.config, useRequireJs); var files = _.flatten( _.map( - ['libraryFiles', 'sourceFiles', 'specFiles', 'fixtureFiles', 'runFiles'], + ['libraryFilesToInclude', 'libraryFiles', 'sourceFiles', 'specFiles', 'fixtureFiles', 'runFiles'], function(item) { return data.files[item] || []; } ) ); @@ -305,6 +305,10 @@ var configure = function(data) { {pattern: path.join(appRoot, 'common/static/common/js/jasmine.common.conf.js'), included: true} ); + if (useRequireJs) { + files.unshift({pattern: 'common/js/utils/require-serial.js', included: true}); + } + files = setDefaults(files); // With nocache=true, Karma always serves the latest files from disk. diff --git a/common/static/karma_common.conf.js b/common/static/karma_common.conf.js index 5fdf9f5a2b..bf267c07e1 100644 --- a/common/static/karma_common.conf.js +++ b/common/static/karma_common.conf.js @@ -8,28 +8,34 @@ var path = require('path'); var configModule = require(path.join(__dirname, '../../common/static/common/js/karma.common.conf.js')); var files = { - libraryFiles: [ + libraryFilesToInclude: [ + {pattern: 'coffee/src/ajax_prefix.js', included: true}, + {pattern: 'js/vendor/draggabilly.js', included: true}, {pattern: 'js/vendor/jquery.min.js', included: true}, - {pattern: 'js/vendor/jasmine-imagediff.js', included: true}, - {pattern: 'js/libs/jasmine-waituntil.js', included: true}, - {pattern: 'js/libs/jasmine-extensions.js', included: true}, + {pattern: 'coffee/src/jquery.immediateDescendents.js', included: true}, + {pattern: 'js/vendor/jquery.leanModal.js', included: true}, + {pattern: 'js/vendor/jquery.timeago.js', included: true}, {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}, + {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}, - {pattern: 'js/vendor/jquery.timeago.js', included: true}, - {pattern: 'js/vendor/URI.min.js', included: true}, - {pattern: 'coffee/src/ajax_prefix.js', included: true}, - {pattern: 'js/test/add_ajax_prefix.js', included: true}, - {pattern: 'js/test/i18n.js', included: true}, - {pattern: 'coffee/src/jquery.immediateDescendents.js', included: true}, - {pattern: 'js/vendor/jquery.leanModal.js', included: true}, - {pattern: 'js/vendor/draggabilly.js', included: true}, + {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}, - {pattern: 'edx-pattern-library/js/edx-icons.js', included: true} + {pattern: 'edx-pattern-library/js/edx-icons.js', included: true}, + + {pattern: 'js/vendor/jasmine-imagediff.js', included: true}, + {pattern: 'js/libs/jasmine-waituntil.js', included: true}, + {pattern: 'js/libs/jasmine-extensions.js', included: true} + ], + + libraryFiles: [ ], sourceFiles: [ diff --git a/common/static/karma_common_requirejs.conf.js b/common/static/karma_common_requirejs.conf.js index 3bcf77409f..d0a5e641a7 100644 --- a/common/static/karma_common_requirejs.conf.js +++ b/common/static/karma_common_requirejs.conf.js @@ -9,31 +9,22 @@ var path = require('path'); var configModule = require(path.join(__dirname, '../../common/static/common/js/karma.common.conf.js')); var files = { + libraryFilesToInclude: [ + {pattern: 'js/libs/jasmine-extensions.js', included: true} + ], + libraryFiles: [ - {pattern: 'js/vendor/jquery.min.js'}, - {pattern: 'js/vendor/jasmine-imagediff.js'}, - {pattern: 'js/libs/jasmine-stealth.js'}, - {pattern: 'js/libs/jasmine-waituntil.js'}, - {pattern: 'js/libs/jasmine-extensions.js'}, - {pattern: 'js/vendor/jquery.simulate.js'}, - {pattern: 'js/vendor/jquery.truncate.js'}, - {pattern: 'common/js/vendor/underscore.js'}, - {pattern: 'common/js/vendor/underscore.string.js'}, - {pattern: 'common/js/vendor/backbone.js'}, - {pattern: 'js/vendor/backbone.paginator.min.js'}, - {pattern: 'js/vendor/jquery.timeago.js'}, - {pattern: 'js/vendor/URI.min.js'}, - {pattern: 'coffee/src/ajax_prefix.js'}, - {pattern: 'js/test/add_ajax_prefix.js'}, - {pattern: 'js/test/i18n.js'}, - {pattern: 'coffee/src/jquery.immediateDescendents.js'}, - {pattern: 'js/vendor/requirejs/text.js'}, - {pattern: 'js/vendor/sinon-1.17.0.js'}, - {pattern: 'common/js/utils/require-serial.js', included: true} + {pattern: 'coffee/src/**/*.js'}, + {pattern: 'common/js/spec_helpers/**/*.js'}, + {pattern: 'common/js/vendor/**/*.js'}, + {pattern: 'js/libs/**/*.js'}, + {pattern: 'js/test/**/*.js'}, + {pattern: 'js/vendor/**/*.js'} ], sourceFiles: [ - {pattern: 'common/js/**/!(*spec).js'} + {pattern: 'common/js/components/**/!(*spec).js'}, + {pattern: 'common/js/utils/**/!(*spec).js'} ], specFiles: [ diff --git a/lms/static/js/spec/main_requirejs_coffee.js b/lms/static/js/spec/main_requirejs_coffee.js index 0597f1e952..541d4f763d 100644 --- a/lms/static/js/spec/main_requirejs_coffee.js +++ b/lms/static/js/spec/main_requirejs_coffee.js @@ -4,9 +4,9 @@ baseUrl: '/base/', paths: { "moment": "xmodule_js/common_static/js/vendor/moment.min", - "modernizr": "xmodule_js/common_static/edx-pattern-library/js/modernizr-custom", - "afontgarde": "xmodule_js/common_static/edx-pattern-library/js/afontgarde", - "edxicons": "xmodule_js/common_static/edx-pattern-library/js/edx-icons", + "modernizr": "edx-pattern-library/js/modernizr-custom", + "afontgarde": "edx-pattern-library/js/afontgarde", + "edxicons": "edx-pattern-library/js/edx-icons", "draggabilly": "xmodule_js/common_static/js/vendor/draggabilly" }, "moment": { diff --git a/lms/static/karma_lms.conf.js b/lms/static/karma_lms.conf.js index 29ef09f3e0..609b4b9ac6 100644 --- a/lms/static/karma_lms.conf.js +++ b/lms/static/karma_lms.conf.js @@ -8,92 +8,47 @@ var path = require('path'); var configModule = require(path.join(__dirname, '../../common/static/common/js/karma.common.conf.js')); var files = { - libraryFiles: [ - {pattern: 'xmodule_js/common_static/js/test/i18n.js'}, - {pattern: 'xmodule_js/common_static/coffee/src/ajax_prefix.js'}, - {pattern: 'xmodule_js/common_static/js/src/logger.js'}, - {pattern: 'xmodule_js/common_static/js/vendor/requirejs/require.js'}, - {pattern: 'js/RequireJS-namespace-undefine.js'}, - {pattern: 'xmodule_js/common_static/js/vendor/requirejs/text.js'}, - {pattern: 'xmodule_js/common_static/js/vendor/jquery.min.js', included: true}, - {pattern: 'xmodule_js/common_static/js/vendor/jquery-ui.min.js', included: true}, - {pattern: 'xmodule_js/common_static/js/vendor/jquery.simulate.js'}, - {pattern: 'xmodule_js/common_static/js/vendor/jquery.cookie.js'}, - {pattern: 'xmodule_js/common_static/js/vendor/jquery.timeago.js'}, - {pattern: 'xmodule_js/common_static/js/vendor/flot/jquery.flot.js'}, - {pattern: 'xmodule_js/common_static/js/vendor/CodeMirror/codemirror.js'}, - {pattern: 'xmodule_js/common_static/js/vendor/URI.min.js'}, - {pattern: 'xmodule_js/common_static/js/vendor/jQuery-File-Upload/js/jquery.fileupload.js'}, - {pattern: 'xmodule_js/common_static/js/vendor/jQuery-File-Upload/js/jquery.iframe-transport.js'}, - {pattern: 'xmodule_js/common_static/js/vendor/url.min.js'}, - {pattern: 'xmodule_js/common_static/coffee/src/jquery.immediateDescendents.js'}, - {pattern: 'xmodule_js/common_static/js/xblock/**/*.js'}, - {pattern: 'xmodule_js/common_static/coffee/src/xblock/**/*.js'}, - {pattern: 'coffee/src/instructor_dashboard/**/*.js'}, - {pattern: 'xmodule_js/common_static/js/vendor/sinon-1.17.0.js'}, - {pattern: 'xmodule_js/src/capa/**/*.js'}, - {pattern: 'xmodule_js/src/video/**/*.js'}, - {pattern: 'xmodule_js/src/xmodule.js'}, - {pattern: 'xmodule_js/common_static/js/src/**/*.js'}, - {pattern: 'xmodule_js/common_static/common/js/vendor/underscore.js'}, - {pattern: 'xmodule_js/common_static/common/js/vendor/underscore.string.js'}, - {pattern: 'xmodule_js/common_static/common/js/vendor/backbone.js'}, - {pattern: 'xmodule_js/common_static/js/vendor/backbone.paginator.min.js'}, - {pattern: 'xmodule_js/common_static/js/vendor/edxnotes/annotator-full.min.js'}, - {pattern: 'xmodule_js/common_static/js/test/i18n.js'}, - {pattern: 'xmodule_js/common_static/js/vendor/date.js'}, - {pattern: 'xmodule_js/common_static/js/vendor/moment.min.js'}, - {pattern: 'xmodule_js/common_static/js/vendor/moment-with-locales.min.js'}, - {pattern: 'xmodule_js/common_static/common/js/utils/edx.utils.validate.js'}, + libraryFilesToInclude: [ {pattern: 'xmodule_js/common_static/js/vendor/jquery.event.drag-2.2.js', included: true}, {pattern: 'xmodule_js/common_static/js/vendor/slick.core.js', included: true}, {pattern: 'xmodule_js/common_static/js/vendor/slick.grid.js', included: true}, - {pattern: 'xmodule_js/common_static/js/libs/jasmine-waituntil.js', included: true}, {pattern: 'xmodule_js/common_static/js/libs/jasmine-extensions.js', included: true}, - {pattern: 'common/js/utils/require-serial.js', included: true} + {pattern: 'xmodule_js/common_static/js/libs/jasmine-waituntil.js', included: true} ], - sourceFiles: [ - {pattern: 'js/**/!(*spec).js'}, - {pattern: 'coffee/src/**/*.js'}, + libraryFiles: [ {pattern: 'common/js/**/*.js'}, {pattern: 'edx-pattern-library/js/**/*.js'}, {pattern: 'edx-ui-toolkit/js/**/*.js'}, + {pattern: 'js/RequireJS-namespace-undefine.js'}, + {pattern: 'xmodule_js/common_static/coffee/src/**/*.js'}, + {pattern: 'xmodule_js/common_static/common/js/**/*.js'}, + {pattern: 'xmodule_js/common_static/js/**/*.js'}, + {pattern: 'xmodule_js/src/capa/*.js'}, + {pattern: 'xmodule_js/src/video/*.js'}, + {pattern: 'xmodule_js/src/xmodule.js'} + ], + + sourceFiles: [ + {pattern: 'coffee/src/**/!(*spec).js'}, + {pattern: 'js/**/!(*spec).js'}, {pattern: 'support/js/**/!(*spec).js'}, {pattern: 'teams/js/**/!(*spec).js'}, - {pattern: 'xmodule_js/common_static/coffee/**/*.js'} + {pattern: 'xmodule_js/common_static/coffee/**/!(*spec).js'}, ], specFiles: [ {pattern: 'js/spec/**/*spec.js'}, - {pattern: 'teams/js/spec/**/*spec.js'}, - {pattern: 'support/js/spec/**/*spec.js'} + {pattern: 'support/js/spec/**/*spec.js'}, + {pattern: 'teams/js/spec/**/*spec.js'} ], fixtureFiles: [ {pattern: 'js/fixtures/**/*.html'}, - {pattern: 'templates/instructor/instructor_dashboard_2/**/*.*'}, - {pattern: 'templates/dashboard/**/*.*'}, - {pattern: 'templates/edxnotes/**/*.*'}, - {pattern: 'templates/fields/**/*.*'}, - {pattern: 'templates/student_account/**/*.*'}, - {pattern: 'templates/student_profile/**/*.*'}, - {pattern: 'templates/verify_student/**/*.*'}, - {pattern: 'templates/file-upload.underscore'}, - {pattern: 'templates/components/header/**/*.*'}, - {pattern: 'templates/components/tabbed/**/*.*'}, - {pattern: 'templates/components/card/**/*.*'}, - {pattern: 'templates/financial-assistance/**/*.*'}, - {pattern: 'templates/search/**/*.*'}, - {pattern: 'templates/discovery/**/*.*'}, {pattern: 'common/templates/**/*.*'}, - {pattern: 'teams/templates/**/*.*'}, {pattern: 'support/templates/**/*.*'}, - {pattern: 'templates/bookmarks/**/*.*'}, - {pattern: 'templates/learner_dashboard/**/*.*'}, - {pattern: 'templates/ccx/**/*.*'}, - {pattern: 'templates/commerce/receipt.underscore'}, - {pattern: 'templates/api_admin/**/*.*', included: false} + {pattern: 'teams/templates/**/*.*'}, + {pattern: 'templates/**/*.*'} ], runFiles: [ diff --git a/lms/static/karma_lms_coffee.conf.js b/lms/static/karma_lms_coffee.conf.js index d6066213f7..f488b35664 100644 --- a/lms/static/karma_lms_coffee.conf.js +++ b/lms/static/karma_lms_coffee.conf.js @@ -9,40 +9,44 @@ var path = require('path'); var configModule = require(path.join(__dirname, '../../common/static/common/js/karma.common.conf.js')); var files = { - libraryFiles: [ - {pattern: 'xmodule_js/common_static/js/vendor/jquery.min.js', included: true}, - {pattern: 'xmodule_js/common_static/js/test/i18n.js', included: true}, - {pattern: 'xmodule_js/common_static/coffee/src/ajax_prefix.js', included: true}, - {pattern: 'xmodule_js/common_static/js/src/logger.js', included: true}, - {pattern: 'xmodule_js/common_static/common/js/vendor/underscore.js', included: true}, - {pattern: 'xmodule_js/common_static/js/vendor/jasmine-imagediff.js', included: true}, - {pattern: 'xmodule_js/common_static/js/libs/jasmine-extensions.js', included: true}, + libraryFilesToInclude: [ {pattern: 'xmodule_js/common_static/js/vendor/requirejs/require.js', included: true}, {pattern: 'js/spec/main_requirejs_coffee.js', included: true}, + {pattern: 'js/RequireJS-namespace-undefine.js', included: true}, - {pattern: 'xmodule_js/common_static/js/vendor/jquery-ui.min.js', included: true}, + {pattern: 'xmodule_js/common_static/coffee/src/ajax_prefix.js', included: true}, + {pattern: 'xmodule_js/common_static/common/js/vendor/underscore.js', included: true}, + {pattern: 'xmodule_js/common_static/edx-ui-toolkit/js/utils/global-loader.js', included: true}, + {pattern: 'xmodule_js/common_static/js/src/logger.js', included: true}, + {pattern: 'xmodule_js/common_static/js/test/i18n.js', included: true}, + {pattern: 'xmodule_js/common_static/js/vendor/CodeMirror/codemirror.js', included: true}, + {pattern: 'xmodule_js/common_static/js/vendor/jquery.min.js', included: true}, {pattern: 'xmodule_js/common_static/js/vendor/jquery.cookie.js', included: true}, {pattern: 'xmodule_js/common_static/js/vendor/flot/jquery.flot.js', included: true}, + {pattern: 'xmodule_js/common_static/coffee/src/jquery.immediateDescendents.js', included: true}, + {pattern: 'xmodule_js/common_static/js/vendor/jquery-ui.min.js', included: true}, {pattern: 'xmodule_js/common_static/js/vendor/moment.min.js', included: true}, {pattern: 'xmodule_js/common_static/js/vendor/moment-with-locales.min.js', included: true}, - {pattern: 'xmodule_js/common_static/js/vendor/CodeMirror/codemirror.js', included: true}, {pattern: 'xmodule_js/common_static/js/vendor/URI.min.js', included: true}, - {pattern: 'xmodule_js/common_static/coffee/src/jquery.immediateDescendents.js', included: true}, + {pattern: 'xmodule_js/common_static/js/xblock/*.js', included: true}, {pattern: 'xmodule_js/common_static/coffee/src/xblock/*.js', included: true}, - {pattern: 'moment_requirejs.js', included: true}, {pattern: 'xmodule_js/src/capa/*.js', included: true}, {pattern: 'xmodule_js/src/video/*.js', included: true}, {pattern: 'xmodule_js/src/xmodule.js', included: true}, - {pattern: 'xmodule_js/common_static/js/vendor/draggabilly.js'}, - {pattern: 'xmodule_js/common_static/edx-ui-toolkit/js/utils/global-loader.js', included: true}, - {pattern: 'xmodule_js/common_static/edx-pattern-library/js/modernizr-custom.js'}, - {pattern: 'xmodule_js/common_static/edx-pattern-library/js/afontgarde.js'}, - {pattern: 'xmodule_js/common_static/edx-pattern-library/js/edx-icons.js'} + + {pattern: 'xmodule_js/common_static/js/vendor/jasmine-imagediff.js', included: true}, + {pattern: 'xmodule_js/common_static/js/libs/jasmine-extensions.js', included: true} + ], + + libraryFiles: [ + {pattern: 'edx-pattern-library/js/**/*.js'}, + {pattern: 'edx-ui-toolkit/js/**/*.js'}, + {pattern: 'xmodule_js/common_static/js/vendor/**/*.js'} ], sourceFiles: [ - {pattern: 'coffee/src/**/*.js', included: true} + {pattern: 'coffee/src/**/*.js', included: true}, ], specFiles: [ diff --git a/lms/static/moment_requirejs.js b/lms/static/moment_requirejs.js deleted file mode 100644 index 745cd0b5c1..0000000000 --- a/lms/static/moment_requirejs.js +++ /dev/null @@ -1,15 +0,0 @@ -(function(requirejs) { - 'use strict'; - - requirejs.config({ - paths: { - "moment": "/base/xmodule_js/common_static/js/vendor/moment.min" - }, - shim:{ - "moment": { - exports: "moment" - } - } - }); - -}).call(this, RequireJS.requirejs);