Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
ecommerce
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
ecommerce
Commits
167b1688
Commit
167b1688
authored
Aug 19, 2015
by
Clinton Blackburn
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #292 from edx/clintonb/spec-runner-update
Removed browser references from spec-runner
parents
7d198b78
565c2dce
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
47 deletions
+20
-47
ecommerce/static/js/test/spec-runner.js
+20
-47
No files found.
ecommerce/static/js/test/spec-runner.js
View file @
167b1688
...
@@ -3,58 +3,31 @@
...
@@ -3,58 +3,31 @@
* add files to the karma configuration.
* add files to the karma configuration.
*/
*/
var
isBrowser
=
window
.
__karma__
===
undefined
,
var
specs
=
[],
specs
=
[],
config
=
{};
config
=
{};
// Two execution paths: browser or gulp
// the E-Commerce application loads gettext identity library via django, thus
if
(
isBrowser
)
{
// components reference gettext globally so a shim is added here to reflect
// The browser cannot read directories, so all files must be enumerated below.
// the text so tests can be run if modules reference gettext
specs
=
[
if
(
!
window
.
gettext
)
{
config
.
baseUrl
+
'js/test/specs/course_create_view_spec.js'
,
window
.
gettext
=
function
(
text
)
{
config
.
baseUrl
+
'js/test/specs/course_edit_view_spec.js'
,
'use strict'
;
config
.
baseUrl
+
'js/test/specs/course_detail_view_spec.js'
,
return
text
;
config
.
baseUrl
+
'js/test/specs/course_list_view_spec.js'
};
];
}
}
else
{
// the E-Commerce application loads gettext identity library via django, thus
// components reference gettext globally so a shim is added here to reflect
// the text so tests can be run if modules reference gettext
if
(
!
window
.
gettext
)
{
window
.
gettext
=
function
(
text
)
{
'use strict'
;
return
text
;
};
}
// you can automatically get the test files using karma's configs
// you can automatically get the test files using karma's configs
for
(
var
file
in
window
.
__karma__
.
files
)
{
for
(
var
file
in
window
.
__karma__
.
files
)
{
if
(
/js
\/
test
\/
specs
\/
.*spec
\.
js$/
.
test
(
file
))
{
if
(
/js
\/
test
\/
specs
\/
.*spec
\.
js$/
.
test
(
file
))
{
specs
.
push
(
file
);
specs
.
push
(
file
);
}
}
}
}
// This is where karma puts the files
// This is where karma puts the files
config
.
baseUrl
=
'/base/ecommerce/static/'
;
config
.
baseUrl
=
'/base/ecommerce/static/'
;
// Karma lets you list the test files here
// Karma lets you list the test files here
config
.
deps
=
specs
;
config
.
deps
=
specs
;
config
.
callback
=
window
.
__karma__
.
start
;
config
.
callback
=
window
.
__karma__
.
start
;
}
requirejs
.
config
(
config
);
requirejs
.
config
(
config
);
// the browser needs to kick off jasmine. The gulp task does it through
// node
if
(
isBrowser
)
{
// jasmine 2.0 needs boot.js to run, which loads on a window load, so this is
// a hack
// http://stackoverflow.com/questions/19240302/does-jasmine-2-0-really-not-work-with-require-js
require
([
'boot'
],
function
()
{
'use strict'
;
require
(
specs
,
function
()
{
window
.
onload
();
});
});
}
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