diff --git a/cms/static/coffee/spec/main.coffee b/cms/static/coffee/spec/main.coffee index c5d1df72b3..f42b2f74f5 100644 --- a/cms/static/coffee/spec/main.coffee +++ b/cms/static/coffee/spec/main.coffee @@ -44,8 +44,6 @@ requirejs.config({ "sinon": "xmodule_js/common_static/js/vendor/sinon-1.17.0", "squire": "xmodule_js/common_static/js/vendor/Squire", "jasmine-imagediff": "xmodule_js/common_static/js/vendor/jasmine-imagediff", - "jasmine-stealth": "xmodule_js/common_static/js/libs/jasmine-stealth", - "jasmine-waituntil": "xmodule_js/common_static/js/libs/jasmine-waituntil", "draggabilly": "xmodule_js/common_static/js/vendor/draggabilly", "domReady": "xmodule_js/common_static/js/vendor/domReady", "URI": "xmodule_js/common_static/js/vendor/URI.min", @@ -180,10 +178,13 @@ requirejs.config({ exports: "sinon" }, "jasmine-imagediff": {}, - "jasmine-stealth": { + "common/js/spec_helpers/jasmine-extensions": { + deps: ["jquery"] + }, + "common/js/spec_helpers/jasmine-stealth": { deps: ["underscore", "underscore.string"] }, - "jasmine-waituntil": { + "common/js/spec_helpers/jasmine-waituntil": { deps: ["jquery"] }, "xblock/core": { @@ -283,8 +284,14 @@ while i < testFiles.length testFiles[i] = '/base/' + testFiles[i] + '.js' i++ +specHelpers = [ + 'common/js/spec_helpers/jasmine-extensions', + 'common/js/spec_helpers/jasmine-stealth', + 'common/js/spec_helpers/jasmine-waituntil' +] + # Jasmine has a global stack for creating a tree of specs. We need to load # spec files one by one, otherwise some end up getting nested under others. -requireSerial testFiles, -> +requireSerial specHelpers.concat(testFiles), -> # start test run, once Require.js is done window.__karma__.start() diff --git a/cms/static/coffee/spec/main_spec.coffee b/cms/static/coffee/spec/main_spec.coffee index ee68e31326..39098691ea 100644 --- a/cms/static/coffee/spec/main_spec.coffee +++ b/cms/static/coffee/spec/main_spec.coffee @@ -1,5 +1,4 @@ -require ["jquery", "backbone", "coffee/src/main", "common/js/spec_helpers/ajax_helpers", - "jasmine-stealth", "jasmine-waituntil", "jquery.cookie"], +require ["jquery", "backbone", "coffee/src/main", "common/js/spec_helpers/ajax_helpers", "jquery.cookie"], ($, Backbone, main, AjaxHelpers) -> describe "CMS", -> it "should initialize URL", -> diff --git a/cms/static/coffee/spec/main_squire.coffee b/cms/static/coffee/spec/main_squire.coffee index a3480f3516..646975976b 100644 --- a/cms/static/coffee/spec/main_squire.coffee +++ b/cms/static/coffee/spec/main_squire.coffee @@ -41,8 +41,6 @@ requirejs.config({ "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", - "jasmine-stealth": "xmodule_js/common_static/js/libs/jasmine-stealth", - "jasmine-waituntil": "xmodule_js/common_static/js/libs/jasmine-waituntil", "draggabilly": "xmodule_js/common_static/js/vendor/draggabilly", "domReady": "xmodule_js/common_static/js/vendor/domReady", "URI": "xmodule_js/common_static/js/vendor/URI.min", @@ -160,10 +158,13 @@ requirejs.config({ "sinon": { exports: "sinon" }, - "jasmine-stealth": { + "common/js/spec_helpers/jasmine-extensions": { + deps: ["jquery"] + }, + "common/js/spec_helpers/jasmine-stealth": { deps: ["underscore", "underscore.string"] }, - "jasmine-waituntil": { + "common/js/spec_helpers/jasmine-waituntil": { deps: ["jquery"] }, "xblock/core": { @@ -203,8 +204,14 @@ while i < testFiles.length testFiles[i] = '/base/' + testFiles[i] + '.js' i++ +specHelpers = [ + 'common/js/spec_helpers/jasmine-extensions', + 'common/js/spec_helpers/jasmine-stealth', + 'common/js/spec_helpers/jasmine-waituntil' +] + # Jasmine has a global stack for creating a tree of specs. We need to load # spec files one by one, otherwise some end up getting nested under others. -requireSerial testFiles, -> +requireSerial specHelpers.concat(testFiles), -> # start test run, once Require.js is done window.__karma__.start() diff --git a/cms/static/coffee/spec/views/textbook_spec.coffee b/cms/static/coffee/spec/views/textbook_spec.coffee index 01e6134d58..b2a251fb6d 100644 --- a/cms/static/coffee/spec/views/textbook_spec.coffee +++ b/cms/static/coffee/spec/views/textbook_spec.coffee @@ -2,7 +2,7 @@ define ["js/models/textbook", "js/models/chapter", "js/collections/chapter", "js "js/collections/textbook", "js/views/show_textbook", "js/views/edit_textbook", "js/views/list_textbooks", "js/views/edit_chapter", "common/js/components/views/feedback_prompt", "common/js/components/views/feedback_notification", "common/js/components/utils/view_utils","common/js/spec_helpers/ajax_helpers", - "js/spec_helpers/modal_helpers", "jasmine-stealth"], + "js/spec_helpers/modal_helpers"], (Textbook, Chapter, ChapterSet, Course, TextbookSet, ShowTextbook, EditTextbook, ListTextbooks, EditChapter, Prompt, Notification, ViewUtils, AjaxHelpers, modal_helpers) -> describe "ShowTextbook", -> diff --git a/cms/static/js/spec/views/group_configuration_spec.js b/cms/static/js/spec/views/group_configuration_spec.js index b049f2f190..db924cfb62 100644 --- a/cms/static/js/spec/views/group_configuration_spec.js +++ b/cms/static/js/spec/views/group_configuration_spec.js @@ -5,7 +5,7 @@ define([ 'js/views/group_configuration_item', 'js/views/experiment_group_edit', 'js/views/content_group_list', 'js/views/content_group_details', 'js/views/content_group_editor', 'js/views/content_group_item', 'common/js/components/views/feedback_notification', 'common/js/spec_helpers/ajax_helpers', 'common/js/spec_helpers/template_helpers', - 'common/js/spec_helpers/view_helpers', 'jasmine-stealth' + 'common/js/spec_helpers/view_helpers' ], function( _, Course, GroupConfigurationModel, GroupModel, GroupConfigurationCollection, GroupCollection, GroupConfigurationDetailsView, GroupConfigurationsListView, GroupConfigurationEditorView, diff --git a/cms/static/karma_cms.conf.js b/cms/static/karma_cms.conf.js index 076221ac8f..8e0a2b0950 100644 --- a/cms/static/karma_cms.conf.js +++ b/cms/static/karma_cms.conf.js @@ -8,10 +8,6 @@ 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: 'edx-pattern-library/js/**/*.js'}, {pattern: 'edx-ui-toolkit/js/**/*.js'}, @@ -19,9 +15,6 @@ var files = { {pattern: 'xmodule_js/common_static/common/js/vendor/**/*.js'}, {pattern: 'xmodule_js/common_static/js/**/*.js'}, {pattern: 'xmodule_js/src/xmodule.js'}, - - {pattern: 'xmodule_js/common_static/js/libs/jasmine-stealth.js'}, - {pattern: 'xmodule_js/common_static/js/libs/jasmine-waituntil.js'} ], sourceFiles: [ diff --git a/cms/static/karma_cms_squire.conf.js b/cms/static/karma_cms_squire.conf.js index 097e80aa11..2737ec359b 100644 --- a/cms/static/karma_cms_squire.conf.js +++ b/cms/static/karma_cms_squire.conf.js @@ -8,10 +8,6 @@ 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: 'edx-pattern-library/js/**/*.js'}, {pattern: 'edx-ui-toolkit/js/**/*.js'}, diff --git a/common/lib/xmodule/xmodule/js/karma_xmodule.conf.js b/common/lib/xmodule/xmodule/js/karma_xmodule.conf.js index cf010e0b9c..d61c82f7ee 100644 --- a/common/lib/xmodule/xmodule/js/karma_xmodule.conf.js +++ b/common/lib/xmodule/xmodule/js/karma_xmodule.conf.js @@ -39,8 +39,8 @@ var files = { {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/common/js/spec_helpers/jasmine-waituntil.js', included: true}, + {pattern: 'common_static/common/js/spec_helpers/jasmine-extensions.js', included: true}, {pattern: 'common_static/js/vendor/sinon-1.17.0.js', included: true} ], diff --git a/common/static/common/js/spec/components/feedback_spec.js b/common/static/common/js/spec/components/feedback_spec.js index ed390c1810..9f61a36d7d 100644 --- a/common/static/common/js/spec/components/feedback_spec.js +++ b/common/static/common/js/spec/components/feedback_spec.js @@ -3,7 +3,7 @@ 'use strict'; define(["jquery", "common/js/components/views/feedback", "common/js/components/views/feedback_notification", "common/js/components/views/feedback_alert", "common/js/components/views/feedback_prompt", - 'common/js/spec_helpers/view_helpers', "sinon", "jquery.simulate", "jasmine-waituntil"], + 'common/js/spec_helpers/view_helpers', "sinon", "jquery.simulate"], function($, SystemFeedback, NotificationView, AlertView, PromptView, ViewHelpers, sinon) { var tpl; tpl = readFixtures('common/templates/components/system-feedback.underscore'); diff --git a/common/static/common/js/spec/components/view_utils_spec.js b/common/static/common/js/spec/components/view_utils_spec.js index 6ac85efe88..cef36bc46d 100644 --- a/common/static/common/js/spec/components/view_utils_spec.js +++ b/common/static/common/js/spec/components/view_utils_spec.js @@ -1,7 +1,7 @@ ;(function (define) { 'use strict'; define(["jquery", "underscore", "backbone", "common/js/components/utils/view_utils", - "common/js/spec_helpers/view_helpers", "jasmine-stealth"], + "common/js/spec_helpers/view_helpers"], function ($, _, Backbone, ViewUtils, ViewHelpers) { describe("ViewUtils", function() { diff --git a/common/static/common/js/spec/main_requirejs.js b/common/static/common/js/spec/main_requirejs.js index c859348826..15fc9ca853 100644 --- a/common/static/common/js/spec/main_requirejs.js +++ b/common/static/common/js/spec/main_requirejs.js @@ -34,10 +34,7 @@ 'modernizr': 'edx-pattern-library/js/modernizr-custom', 'afontgarde': 'edx-pattern-library/js/afontgarde', 'edxicons': 'edx-pattern-library/js/edx-icons', - 'draggabilly': 'js/vendor/draggabilly', - 'jasmine-stealth': 'js/libs/jasmine-stealth', - 'jasmine-waituntil': 'js/libs/jasmine-waituntil', - 'jasmine-extensions': 'js/libs/jasmine-extensions' + 'draggabilly': 'js/vendor/draggabilly' }, shim: { 'gettext': { @@ -140,13 +137,13 @@ exports: 'URI' }, 'jasmine-imagediff': {}, - 'jasmine-stealth': { - deps: ['underscore', 'underscore.string'] - }, - 'jasmine-waituntil': { + 'common/js/spec_helpers/jasmine-extensions': { deps: ['jquery'] }, - 'jasmine-extensions': { + 'common/js/spec_helpers/jasmine-stealth': { + deps: ['underscore', 'underscore.string'] + }, + 'common/js/spec_helpers/jasmine-waituntil': { deps: ['jquery'] }, "sinon": { @@ -178,7 +175,13 @@ testFiles[i] = '/base/' + testFiles[i]; } - window.requireSerial(testFiles, function () { + var specHelpers = [ + 'common/js/spec_helpers/jasmine-extensions', + 'common/js/spec_helpers/jasmine-stealth', + 'common/js/spec_helpers/jasmine-waituntil' + ]; + + window.requireSerial(specHelpers.concat(testFiles), function () { // start test run, once Require.js is done window.__karma__.start(); }); diff --git a/common/static/js/libs/jasmine-extensions.js b/common/static/common/js/spec_helpers/jasmine-extensions.js similarity index 100% rename from common/static/js/libs/jasmine-extensions.js rename to common/static/common/js/spec_helpers/jasmine-extensions.js diff --git a/common/static/js/libs/jasmine-stealth.js b/common/static/common/js/spec_helpers/jasmine-stealth.js similarity index 100% rename from common/static/js/libs/jasmine-stealth.js rename to common/static/common/js/spec_helpers/jasmine-stealth.js diff --git a/common/static/js/libs/jasmine-waituntil.js b/common/static/common/js/spec_helpers/jasmine-waituntil.js similarity index 100% rename from common/static/js/libs/jasmine-waituntil.js rename to common/static/common/js/spec_helpers/jasmine-waituntil.js diff --git a/common/static/karma_common.conf.js b/common/static/karma_common.conf.js index bf267c07e1..95f8c45549 100644 --- a/common/static/karma_common.conf.js +++ b/common/static/karma_common.conf.js @@ -31,8 +31,8 @@ var files = { {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} + {pattern: 'common/js/spec_helpers/jasmine-extensions.js', included: true}, + {pattern: 'common/js/spec_helpers/jasmine-waituntil.js', included: true} ], libraryFiles: [ diff --git a/common/static/karma_common_requirejs.conf.js b/common/static/karma_common_requirejs.conf.js index d0a5e641a7..bcfb357929 100644 --- a/common/static/karma_common_requirejs.conf.js +++ b/common/static/karma_common_requirejs.conf.js @@ -9,10 +9,6 @@ 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: 'coffee/src/**/*.js'}, {pattern: 'common/js/spec_helpers/**/*.js'}, diff --git a/lms/static/js/spec/main.js b/lms/static/js/spec/main.js index 61ad7e77c4..b628546545 100644 --- a/lms/static/js/spec/main.js +++ b/lms/static/js/spec/main.js @@ -46,9 +46,6 @@ 'sinon': 'xmodule_js/common_static/js/vendor/sinon-1.17.0', 'squire': 'xmodule_js/common_static/js/vendor/Squire', 'jasmine-imagediff': 'xmodule_js/common_static/js/vendor/jasmine-imagediff', - 'jasmine-stealth': 'xmodule_js/common_static/js/vendor/jasmine-stealth', - 'jasmine-waituntil': 'xmodule_js/common_static/js/libs/jasmine-waituntil', - 'jasmine-extensions': 'xmodule_js/common_static/js/libs/jasmine-extensions', 'domReady': 'xmodule_js/common_static/js/vendor/domReady', 'mathjax': '//cdn.mathjax.org/mathjax/2.6-latest/MathJax.js?config=TeX-MML-AM_SVG&delayStartupUntil=configured', // jshint ignore:line 'youtube': '//www.youtube.com/player_api?noext', @@ -260,13 +257,13 @@ exports: 'sinon' }, 'jasmine-imagediff': {}, - 'jasmine-stealth': { - deps: ['underscore', 'underscore.string'] - }, - 'jasmine-waituntil': { + 'common/js/spec_helpers/jasmine-extensions': { deps: ['jquery'] }, - 'jasmine-extensions': { + 'common/js/spec_helpers/jasmine-stealth': { + deps: ['underscore', 'underscore.string'] + }, + 'common/js/spec_helpers/jasmine-waituntil': { deps: ['jquery'] }, 'xblock/core': { @@ -777,11 +774,16 @@ testFiles[i] = '/base/' + testFiles[i]; } + var specHelpers = [ + 'common/js/spec_helpers/jasmine-extensions', + 'common/js/spec_helpers/jasmine-stealth', + 'common/js/spec_helpers/jasmine-waituntil' + ]; + // Jasmine has a global stack for creating a tree of specs. We need to load // spec files one by one, otherwise some end up getting nested under others. - window.requireSerial(testFiles, function () { + window.requireSerial(specHelpers.concat(testFiles), function () { // start test run, once Require.js is done window.__karma__.start(); }); - }).call(this, requirejs, define); diff --git a/lms/static/karma_lms.conf.js b/lms/static/karma_lms.conf.js index c205595e61..61131571d8 100644 --- a/lms/static/karma_lms.conf.js +++ b/lms/static/karma_lms.conf.js @@ -12,8 +12,6 @@ var files = { {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-extensions.js', included: true}, - {pattern: 'xmodule_js/common_static/js/libs/jasmine-waituntil.js', included: true} ], libraryFiles: [ diff --git a/lms/static/karma_lms_coffee.conf.js b/lms/static/karma_lms_coffee.conf.js index f488b35664..2d7d269054 100644 --- a/lms/static/karma_lms_coffee.conf.js +++ b/lms/static/karma_lms_coffee.conf.js @@ -36,7 +36,7 @@ var files = { {pattern: 'xmodule_js/src/xmodule.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} + {pattern: 'common/js/spec_helpers/jasmine-extensions.js', included: true} ], libraryFiles: [