Moved jasmine addons to common/js/spec_helpers.
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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", ->
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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", ->
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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: [
|
||||
|
||||
@@ -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'},
|
||||
|
||||
@@ -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}
|
||||
],
|
||||
|
||||
|
||||
@@ -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');
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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();
|
||||
});
|
||||
|
||||
@@ -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: [
|
||||
|
||||
@@ -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'},
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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: [
|
||||
|
||||
@@ -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: [
|
||||
|
||||
Reference in New Issue
Block a user