Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
jquery
Project
Project
Details
Activity
Releases
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
夏彬
jquery
Commits
b99972de
Commit
b99972de
authored
Sep 06, 2013
by
Timmy Willison
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use requirejs to load the testswarm inject script
parent
f044622b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
16 deletions
+15
-16
testrunner.js
test/data/testrunner.js
+0
-14
index.html
test/index.html
+15
-2
No files found.
test/data/testrunner.js
View file @
b99972de
...
...
@@ -373,17 +373,3 @@ QUnit.config.testTimeout = 20 * 1000; // 20 seconds
// Enforce an "expect" argument or expect() call in all test bodies.
QUnit
.
config
.
requireExpects
=
true
;
/**
* Load the TestSwarm listener if swarmURL is in the address.
*/
(
function
()
{
var
url
=
window
.
location
.
search
;
url
=
decodeURIComponent
(
url
.
slice
(
url
.
indexOf
(
"swarmURL="
)
+
"swarmURL="
.
length
)
);
if
(
!
url
||
url
.
indexOf
(
"http"
)
!==
0
)
{
return
;
}
document
.
write
(
"<scr"
+
"ipt src='http://swarm.jquery.org/js/inject.js?"
+
(
new
Date
()).
getTime
()
+
"'></scr"
+
"ipt>"
);
})();
test/index.html
View file @
b99972de
...
...
@@ -19,7 +19,9 @@
// Tests are always loaded async
QUnit
.
config
.
autostart
=
false
;
function
loadTests
()
{
var
tests
=
[
var
loadSwarm
,
url
=
window
.
location
.
search
,
tests
=
[
"data/testrunner.js"
,
"unit/core.js"
,
"unit/callbacks.js"
,
...
...
@@ -40,6 +42,9 @@
"unit/offset.js"
,
"unit/dimensions.js"
];
url
=
decodeURIComponent
(
url
.
slice
(
url
.
indexOf
(
"swarmURL="
)
+
"swarmURL="
.
length
)
);
loadSwarm
=
url
&&
url
.
indexOf
(
"http"
)
===
0
;
// Ensure load order (to preserve test numbers)
(
function
loadDep
()
{
var
dep
=
tests
.
shift
();
...
...
@@ -50,7 +55,15 @@
testSubproject
(
"Sizzle"
,
"../bower_components/sizzle/test/"
,
/^unit
\/
.*
\.
js$/
,
function
()
{
// Call load to build module filter select element
QUnit
.
load
();
QUnit
.
start
();
// Load the TestSwarm listener if swarmURL is in the address.
if
(
loadSwarm
)
{
require
(
[
"http://swarm.jquery.org/js/inject.js?"
+
(
new
Date
()).
getTime
()
],
function
()
{
QUnit
.
start
();
});
}
else
{
QUnit
.
start
();
}
});
}
})();
...
...
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