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
667a9b9a
Commit
667a9b9a
authored
May 05, 2016
by
Usman Khalid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved common files into karma.common.conf.js.
parent
6ed93538
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
95 additions
and
100 deletions
+95
-100
cms/static/karma_cms.conf.js
+6
-15
cms/static/karma_cms_squire.conf.js
+6
-15
common/lib/xmodule/xmodule/js/karma_xmodule.conf.js
+9
-7
common/static/common/js/karma.common.conf.js
+39
-9
common/static/karma_common.conf.js
+9
-11
common/static/karma_common_requirejs.conf.js
+10
-16
lms/static/karma_lms.conf.js
+9
-18
lms/static/karma_lms_coffee.conf.js
+7
-9
No files found.
cms/static/karma_cms.conf.js
View file @
667a9b9a
...
...
@@ -7,19 +7,14 @@
var
path
=
require
(
'path'
);
var
configModule
=
require
(
path
.
join
(
__dirname
,
'../../common/static/common/js/karma.common.conf.js'
));
var
files
=
{
libraryFiles
:
[
{
pattern
:
'common/js/vendor/**/*.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/js/**/*.js'
},
{
pattern
:
'xmodule_js/src/xmodule.js'
}
],
var
options
=
{
includeCommonFiles
:
true
,
libraryFiles
:
[],
sourceFiles
:
[
{
pattern
:
'coffee/src/**/!(*spec).js'
},
{
pattern
:
'common/js/**/!(*spec).js'
},
{
pattern
:
'js/**/!(*spec|djangojs).js'
}
],
...
...
@@ -31,7 +26,6 @@ var files = {
fixtureFiles
:
[
{
pattern
:
'coffee/fixtures/**/*.underscore'
},
{
pattern
:
'common/templates/**/*.underscore'
},
{
pattern
:
'templates/**/*.underscore'
}
],
...
...
@@ -41,8 +35,5 @@ var files = {
};
module
.
exports
=
function
(
config
)
{
configModule
.
configure
({
config
:
config
,
files
:
files
});
configModule
.
configure
(
config
,
options
);
};
cms/static/karma_cms_squire.conf.js
View file @
667a9b9a
...
...
@@ -7,19 +7,14 @@
var
path
=
require
(
'path'
);
var
configModule
=
require
(
path
.
join
(
__dirname
,
'../../common/static/common/js/karma.common.conf.js'
));
var
files
=
{
libraryFiles
:
[
{
pattern
:
'common/js/vendor/**/*.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/js/**/*.js'
},
{
pattern
:
'xmodule_js/src/**/*.js'
}
],
var
options
=
{
includeCommonFiles
:
true
,
libraryFiles
:
[],
sourceFiles
:
[
{
pattern
:
'coffee/src/**/!(*spec).js'
},
{
pattern
:
'common/js/**/!(*spec).js'
},
{
pattern
:
'js/**/!(*spec|djangojs).js'
}
],
...
...
@@ -30,7 +25,6 @@ var files = {
fixtureFiles
:
[
{
pattern
:
'coffee/fixtures/**/*.*'
},
{
pattern
:
'common/templates/**/*.*'
},
{
pattern
:
'templates/**/*.*'
}
],
...
...
@@ -40,8 +34,5 @@ var files = {
};
module
.
exports
=
function
(
config
)
{
configModule
.
configure
({
config
:
config
,
files
:
files
});
configModule
.
configure
(
config
,
options
);
};
common/lib/xmodule/xmodule/js/karma_xmodule.conf.js
View file @
667a9b9a
...
...
@@ -8,7 +8,14 @@
var
path
=
require
(
'path'
);
var
configModule
=
require
(
path
.
join
(
__dirname
,
'common_static/common/js/karma.common.conf.js'
));
var
files
=
{
var
options
=
{
useRequireJs
:
false
,
normalizePathsForCoverageFunc
:
function
(
appRoot
,
pattern
)
{
return
pattern
;
},
libraryFilesToInclude
:
[
{
pattern
:
'common_static/js/vendor/requirejs/require.js'
,
included
:
true
},
{
pattern
:
'RequireJS-namespace-undefine.js'
,
included
:
true
},
...
...
@@ -68,10 +75,5 @@ var files = {
};
module
.
exports
=
function
(
config
)
{
configModule
.
configure
({
config
:
config
,
files
:
files
,
normalizePathsForCoverageFunc
:
function
(
appRoot
,
pattern
)
{
return
pattern
;
},
useRequireJs
:
false
});
configModule
.
configure
(
config
,
options
);
};
common/static/common/js/karma.common.conf.js
View file @
667a9b9a
...
...
@@ -29,6 +29,30 @@ var path = require('path');
var
_
=
require
(
'underscore'
);
var
appRoot
=
path
.
join
(
__dirname
,
'../../../../'
);
var
commonFiles
=
{
libraryFiles
:
[
{
pattern
:
'common/js/vendor/**/*.js'
},
{
pattern
:
'edx-pattern-library/js/**/*.js'
},
{
pattern
:
'edx-ui-toolkit/js/**/*.js'
},
{
pattern
:
'xmodule_js/common_static/coffee/src/**/!(*spec).js'
},
{
pattern
:
'xmodule_js/common_static/js/**/!(*spec).js'
},
{
pattern
:
'xmodule_js/src/**/*.js'
}
],
sourceFiles
:
[
{
pattern
:
'common/js/components/**/*.js'
},
{
pattern
:
'common/js/utils/**/*.js'
}
],
specFiles
:
[
{
pattern
:
'common/js/spec_helpers/**/*.js'
}
],
fixtureFiles
:
[
{
pattern
:
'common/templates/**/*.underscore'
}
]
};
/**
* Customize the name attribute in xml testcase element
* @param {Object} browser
...
...
@@ -290,14 +314,20 @@ var getBaseConfig = function (config, useRequireJs) {
};
};
var
configure
=
function
(
data
)
{
var
useRequireJs
=
data
.
useRequireJs
===
undefined
?
true
:
useRequireJs
,
baseConfig
=
getBaseConfig
(
data
.
config
,
useRequireJs
);
var
configure
=
function
(
config
,
options
)
{
var
useRequireJs
=
options
.
useRequireJs
===
undefined
?
true
:
useRequireJs
,
baseConfig
=
getBaseConfig
(
config
,
useRequireJs
);
if
(
options
.
includeCommonFiles
)
{
_
.
forEach
([
'libraryFiles'
,
'sourceFiles'
,
'specFiles'
,
'fixtureFiles'
],
function
(
collectionName
)
{
options
[
collectionName
]
=
_
.
flatten
([
commonFiles
[
collectionName
],
options
[
collectionName
]]);
});
}
var
files
=
_
.
flatten
(
_
.
map
(
[
'libraryFilesToInclude'
,
'libraryFiles'
,
'sourceFiles'
,
'specFiles'
,
'fixtureFiles'
,
'runFiles'
],
function
(
item
)
{
return
data
.
files
[
item
]
||
[];
}
function
(
collectionName
)
{
return
options
[
collectionName
]
||
[];
}
)
);
...
...
@@ -314,22 +344,22 @@ var configure = function(data) {
// With nocache=true, Karma always serves the latest files from disk.
// However, that prevents coverage tracking from working.
// So we only set it if coverage tracking is off.
setNocache
(
files
,
!
data
.
config
.
coverage
);
setNocache
(
files
,
!
config
.
coverage
);
var
filesForCoverage
=
_
.
flatten
(
_
.
map
(
[
'sourceFiles'
,
'specFiles'
],
function
(
item
)
{
return
data
.
files
[
item
];
}
function
(
collectionName
)
{
return
options
[
collectionName
];
}
)
);
var
preprocessors
=
_
.
extend
(
{},
data
.
preprocessors
,
normalizePathsForCoverage
(
filesForCoverage
,
data
.
normalizePathsForCoverageFunc
)
options
.
preprocessors
,
normalizePathsForCoverage
(
filesForCoverage
,
options
.
normalizePathsForCoverageFunc
)
);
data
.
config
.
set
(
_
.
extend
(
baseConfig
,
{
config
.
set
(
_
.
extend
(
baseConfig
,
{
files
:
files
,
preprocessors
:
preprocessors
}));
...
...
common/static/karma_common.conf.js
View file @
667a9b9a
...
...
@@ -7,7 +7,14 @@
var
path
=
require
(
'path'
);
var
configModule
=
require
(
path
.
join
(
__dirname
,
'../../common/static/common/js/karma.common.conf.js'
));
var
files
=
{
var
options
=
{
useRequireJs
:
false
,
normalizePathsForCoverageFunc
:
function
(
appRoot
,
pattern
)
{
return
path
.
join
(
appRoot
,
'/common/static/'
+
pattern
);
},
libraryFilesToInclude
:
[
{
pattern
:
'coffee/src/ajax_prefix.js'
,
included
:
true
},
{
pattern
:
'js/vendor/draggabilly.js'
,
included
:
true
},
...
...
@@ -58,15 +65,6 @@ var files = {
]
};
var
normalizePathsForCoverageFunc
=
function
(
appRoot
,
pattern
)
{
return
path
.
join
(
appRoot
,
'/common/static/'
+
pattern
);
};
module
.
exports
=
function
(
config
)
{
configModule
.
configure
({
config
:
config
,
files
:
files
,
normalizePathsForCoverageFunc
:
normalizePathsForCoverageFunc
,
useRequireJs
:
false
});
configModule
.
configure
(
config
,
options
);
};
common/static/karma_common_requirejs.conf.js
View file @
667a9b9a
...
...
@@ -8,20 +8,22 @@
var
path
=
require
(
'path'
);
var
configModule
=
require
(
path
.
join
(
__dirname
,
'../../common/static/common/js/karma.common.conf.js'
));
var
files
=
{
var
options
=
{
includeCommonFiles
:
true
,
normalizePathsForCoverageFunc
:
function
(
appRoot
,
pattern
)
{
return
path
.
join
(
appRoot
,
'/common/static/'
+
pattern
);
},
libraryFiles
:
[
{
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/components/**/!(*spec).js'
},
{
pattern
:
'common/js/utils/**/!(*spec).js'
}
],
sourceFiles
:
[],
specFiles
:
[
{
pattern
:
'common/js/spec/**/*spec.js'
}
...
...
@@ -36,14 +38,6 @@ var files = {
]
};
var
normalizePathsForCoverageFunc
=
function
(
appRoot
,
pattern
)
{
return
path
.
join
(
appRoot
,
'/common/static/'
+
pattern
);
};
module
.
exports
=
function
(
config
)
{
configModule
.
configure
({
config
:
config
,
files
:
files
,
normalizePathsForCoverageFunc
:
normalizePathsForCoverageFunc
});
configModule
.
configure
(
config
,
options
);
};
lms/static/karma_lms.conf.js
View file @
667a9b9a
...
...
@@ -7,7 +7,10 @@
var
path
=
require
(
'path'
);
var
configModule
=
require
(
path
.
join
(
__dirname
,
'../../common/static/common/js/karma.common.conf.js'
));
var
files
=
{
var
options
=
{
includeCommonFiles
:
true
,
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
},
...
...
@@ -15,34 +18,25 @@ var files = {
],
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/js/**/*.js'
},
{
pattern
:
'xmodule_js/src/capa/*.js'
},
{
pattern
:
'xmodule_js/src/video/*.js'
},
{
pattern
:
'xmodule_js/src/xmodule.js'
}
{
pattern
:
'js/RequireJS-namespace-undefine.js'
}
],
sourceFiles
:
[
{
pattern
:
'coffee/src/**/!(*spec).js'
},
{
pattern
:
'js/**/!(*spec|djangojs).js'
},
{
pattern
:
'support/js/**/!(*spec).js'
},
{
pattern
:
'teams/js/**/!(*spec).js'
},
{
pattern
:
'xmodule_js/common_static/coffee/**/!(*spec).js'
}
{
pattern
:
'teams/js/**/!(*spec).js'
}
],
specFiles
:
[
{
pattern
:
'js/spec/**/*spec.js'
},
{
pattern
:
'support/js/spec/**/*spec.js'
},
{
pattern
:
'teams/js/spec/**/*spec.js'
}
{
pattern
:
'teams/js/spec/**/*spec.js'
},
{
pattern
:
'xmodule_js/common_static/coffee/spec/**/*.js'
}
],
fixtureFiles
:
[
{
pattern
:
'js/fixtures/**/*.html'
},
{
pattern
:
'common/templates/**/*.*'
},
{
pattern
:
'support/templates/**/*.*'
},
{
pattern
:
'teams/templates/**/*.*'
},
{
pattern
:
'templates/**/*.*'
}
...
...
@@ -54,8 +48,5 @@ var files = {
};
module
.
exports
=
function
(
config
)
{
configModule
.
configure
({
config
:
config
,
files
:
files
});
configModule
.
configure
(
config
,
options
);
};
lms/static/karma_lms_coffee.conf.js
View file @
667a9b9a
...
...
@@ -8,7 +8,11 @@
var
path
=
require
(
'path'
);
var
configModule
=
require
(
path
.
join
(
__dirname
,
'../../common/static/common/js/karma.common.conf.js'
));
var
files
=
{
var
options
=
{
useRequireJs
:
false
,
includeCommonFiles
:
true
,
libraryFilesToInclude
:
[
{
pattern
:
'xmodule_js/common_static/js/vendor/requirejs/require.js'
,
included
:
true
},
{
pattern
:
'js/spec/main_requirejs_coffee.js'
,
included
:
true
},
...
...
@@ -40,13 +44,11 @@ var files = {
],
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
:
[
...
...
@@ -59,9 +61,5 @@ var files = {
};
module
.
exports
=
function
(
config
)
{
configModule
.
configure
({
config
:
config
,
files
:
files
,
useRequireJs
:
false
});
configModule
.
configure
(
config
,
options
);
};
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