Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
a2dadeaa
Commit
a2dadeaa
authored
May 05, 2016
by
Usman Khalid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added some documentation to Karma configuration files.
parent
667a9b9a
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
51 additions
and
7 deletions
+51
-7
cms/static/karma_cms.conf.js
+3
-1
cms/static/karma_cms_squire.conf.js
+3
-1
common/lib/xmodule/xmodule/js/karma_xmodule.conf.js
+4
-1
common/static/common/js/karma.common.conf.js
+24
-0
common/static/common/js/spec/main_requirejs.js
+2
-0
common/static/karma_common.conf.js
+4
-1
common/static/karma_common_requirejs.conf.js
+3
-1
lms/static/karma_lms.conf.js
+4
-1
lms/static/karma_lms_coffee.conf.js
+4
-1
No files found.
cms/static/karma_cms.conf.js
View file @
a2dadeaa
// Karma config for cms suite.
// Docs in common/static/common/js/karma.common.conf.js
// Docs
and troubleshooting tips
in common/static/common/js/karma.common.conf.js
/* jshint node: true */
/*jshint -W079 */
...
...
@@ -13,6 +13,8 @@ var options = {
libraryFiles
:
[],
// 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.
sourceFiles
:
[
{
pattern
:
'coffee/src/**/!(*spec).js'
},
{
pattern
:
'js/**/!(*spec|djangojs).js'
}
...
...
cms/static/karma_cms_squire.conf.js
View file @
a2dadeaa
// Karma config for cms-squire suite.
// Docs in common/static/common/js/karma.common.conf.js
// Docs
and troubleshooting tips
in common/static/common/js/karma.common.conf.js
/* jshint node: true */
/*jshint -W079 */
...
...
@@ -13,6 +13,8 @@ var options = {
libraryFiles
:
[],
// 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.
sourceFiles
:
[
{
pattern
:
'coffee/src/**/!(*spec).js'
},
{
pattern
:
'js/**/!(*spec|djangojs).js'
}
...
...
common/lib/xmodule/xmodule/js/karma_xmodule.conf.js
View file @
a2dadeaa
// Karma config for xmodule suite.
// Docs in common/static/common/js/karma.common.conf.js
// Docs
and troubleshooting tips
in common/static/common/js/karma.common.conf.js
/* jshint node: true */
/*jshint -W079 */
...
...
@@ -16,6 +16,7 @@ var options = {
return
pattern
;
},
// Avoid adding files to this list. Use RequireJS.
libraryFilesToInclude
:
[
{
pattern
:
'common_static/js/vendor/requirejs/require.js'
,
included
:
true
},
{
pattern
:
'RequireJS-namespace-undefine.js'
,
included
:
true
},
...
...
@@ -55,6 +56,8 @@ var options = {
{
pattern
:
'common_static/edx-pattern-library/js/**/*.js'
}
],
// 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.
sourceFiles
:
[
{
pattern
:
'src/xmodule.js'
,
included
:
true
,
ignoreCoverage
:
true
},
// To prevent getting instrumented twice.
{
pattern
:
'src/**/*.js'
,
included
:
true
}
...
...
common/static/common/js/karma.common.conf.js
View file @
a2dadeaa
...
...
@@ -19,6 +19,19 @@
//
// where `BROWSER` could be Chrome or Firefox.
//
//
// Troubleshooting tips:
//
// If you get an error like: "TypeError: __cov_KBCc7ZI4xZm8W2BC5NQLDg.s is undefined",
// that means the patterns in sourceFiles and specFiles are matching the same file.
// This causes Istanbul, which is used for tracking coverage to instrument the file
// multiple times.
//
//
// If you see the error: "EMFILE, too many open files" that means the files pattern
// that has been added is matching too many files. The glob library used by Karma
// does not use graceful-fs and tries to read files simultaneously.
//
/* jshint node: true */
...
...
@@ -29,6 +42,7 @@ var path = require('path');
var
_
=
require
(
'underscore'
);
var
appRoot
=
path
.
join
(
__dirname
,
'../../../../'
);
// Files which are needed by all lms/cms suites.
var
commonFiles
=
{
libraryFiles
:
[
{
pattern
:
'common/js/vendor/**/*.js'
},
...
...
@@ -148,6 +162,12 @@ function junitSettings(config) {
};
}
/**
* Return absolute path for files in common and xmodule_js symlink dirs.
* @param {String} appRoot
* @param {String} pattern
* @return {String}
*/
var
defaultNormalizeFunc
=
function
(
appRoot
,
pattern
)
{
if
(
pattern
.
match
(
/^common
\/
js/
))
{
pattern
=
path
.
join
(
appRoot
,
'/common/static/'
+
pattern
);
...
...
@@ -339,6 +359,8 @@ var configure = function(config, options) {
files
.
unshift
({
pattern
:
'common/js/utils/require-serial.js'
,
included
:
true
});
}
// Karma sets included=true by default.
// We set it to false by default because RequireJS should be used instead.
files
=
setDefaults
(
files
);
// With nocache=true, Karma always serves the latest files from disk.
...
...
@@ -353,6 +375,8 @@ var configure = function(config, options) {
)
);
// If we give symlink paths to Istanbul, coverage for each path gets tracked
// separately. So we pass absolute paths to the karma-coverage preprocessor.
var
preprocessors
=
_
.
extend
(
{},
options
.
preprocessors
,
...
...
common/static/common/js/spec/main_requirejs.js
View file @
a2dadeaa
...
...
@@ -181,6 +181,8 @@
'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
(
specHelpers
.
concat
(
testFiles
),
function
()
{
// start test run, once Require.js is done
window
.
__karma__
.
start
();
...
...
common/static/karma_common.conf.js
View file @
a2dadeaa
// Karma config for common suite.
// Docs in common/static/common/js/karma.common.conf.js
// Docs
and troubleshooting tips
in common/static/common/js/karma.common.conf.js
/* jshint node: true */
/*jshint -W079 */
...
...
@@ -15,6 +15,7 @@ var options = {
return
path
.
join
(
appRoot
,
'/common/static/'
+
pattern
);
},
// Avoid adding files to this list. Use RequireJS.
libraryFilesToInclude
:
[
{
pattern
:
'coffee/src/ajax_prefix.js'
,
included
:
true
},
{
pattern
:
'js/vendor/draggabilly.js'
,
included
:
true
},
...
...
@@ -45,6 +46,8 @@ var options = {
libraryFiles
:
[
],
// 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.
sourceFiles
:
[
{
pattern
:
'js/xblock/**/*.js'
,
included
:
true
},
{
pattern
:
'coffee/src/**/*.js'
,
included
:
true
},
...
...
common/static/karma_common_requirejs.conf.js
View file @
a2dadeaa
// Karma config for common-requirejs suite.
// Docs in common/static/common/js/karma.common.conf.js
// Docs
and troubleshooting tips
in common/static/common/js/karma.common.conf.js
/* jshint node: true */
/*jshint -W079 */
...
...
@@ -23,6 +23,8 @@ var options = {
{
pattern
:
'js/vendor/**/*.js'
}
],
// 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.
sourceFiles
:
[],
specFiles
:
[
...
...
lms/static/karma_lms.conf.js
View file @
a2dadeaa
// Karma config for lms suite.
// Docs in common/static/common/js/karma.common.conf.js
// Docs
and troubleshooting tips
in common/static/common/js/karma.common.conf.js
/* jshint node: true */
/*jshint -W079 */
...
...
@@ -11,6 +11,7 @@ var options = {
includeCommonFiles
:
true
,
// Avoid adding files to this list. Use RequireJS.
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
},
...
...
@@ -21,6 +22,8 @@ var options = {
{
pattern
:
'js/RequireJS-namespace-undefine.js'
}
],
// 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.
sourceFiles
:
[
{
pattern
:
'coffee/src/**/!(*spec).js'
},
{
pattern
:
'js/**/!(*spec|djangojs).js'
},
...
...
lms/static/karma_lms_coffee.conf.js
View file @
a2dadeaa
// Karma config for lms-coffee suite.
// Docs in common/static/common/js/karma.common.conf.js
// Docs
and troubleshooting tips
in common/static/common/js/karma.common.conf.js
/* jshint node: true */
/*jshint -W079 */
...
...
@@ -13,6 +13,7 @@ var options = {
useRequireJs
:
false
,
includeCommonFiles
:
true
,
// Avoid adding files to this list. Use RequireJS.
libraryFilesToInclude
:
[
{
pattern
:
'xmodule_js/common_static/js/vendor/requirejs/require.js'
,
included
:
true
},
{
pattern
:
'js/spec/main_requirejs_coffee.js'
,
included
:
true
},
...
...
@@ -47,6 +48,8 @@ var options = {
{
pattern
:
'xmodule_js/common_static/js/vendor/**/*.js'
}
],
// 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.
sourceFiles
:
[
{
pattern
:
'coffee/src/**/*.js'
,
included
:
true
}
],
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment