Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bootstrap
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
Administrator
bootstrap
Commits
1e64c4c0
Commit
1e64c4c0
authored
Jun 18, 2014
by
Heinrich Fenkart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update QUnit settings/QUnit phantomjs bridge to new versions
parent
5830febd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
41 deletions
+44
-41
js/tests/index.html
js/tests/index.html
+10
-11
js/tests/unit/phantom.js
js/tests/unit/phantom.js
+34
-30
No files found.
js/tests/index.html
View file @
1e64c4c0
...
@@ -13,23 +13,22 @@
...
@@ -13,23 +13,22 @@
<script>
<script>
// See https://github.com/axemclion/grunt-saucelabs#test-result-details-with-qunit
// See https://github.com/axemclion/grunt-saucelabs#test-result-details-with-qunit
var
log
=
[]
var
log
=
[]
QUnit
.
done
=
function
(
test_results
)
{
QUnit
.
done
(
function
(
testResults
)
{
var
tests
=
log
.
map
(
function
(
details
)
{
var
tests
=
[]
return
{
for
(
var
i
=
0
,
len
=
log
.
length
;
i
<
len
;
i
++
)
{
var
details
=
log
[
i
]
tests
.
push
({
name
:
details
.
name
,
name
:
details
.
name
,
result
:
details
.
result
,
result
:
details
.
result
,
expected
:
details
.
expected
,
expected
:
details
.
expected
,
actual
:
details
.
actual
,
actual
:
details
.
actual
,
source
:
details
.
source
source
:
details
.
source
}
}
)
}
)
}
test
_r
esults
.
tests
=
tests
test
R
esults
.
tests
=
tests
// Delaying results a bit because in real-world scenario you won't get them immediately
window
.
global_test_results
=
testResults
setTimeout
(
function
()
{
})
window
.
global_test_results
=
test_results
},
2000
)
}
QUnit
.
testStart
(
function
(
testDetails
)
{
QUnit
.
testStart
(
function
(
testDetails
)
{
QUnit
.
log
=
function
(
details
)
{
QUnit
.
log
=
function
(
details
)
{
...
...
js/tests/unit/phantom.js
View file @
1e64c4c0
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* grunt-contrib-qunit
* grunt-contrib-qunit
* http://gruntjs.com/
* http://gruntjs.com/
*
*
* Copyright (c) 201
3
"Cowboy" Ben Alman, contributors
* Copyright (c) 201
4
"Cowboy" Ben Alman, contributors
* Licensed under the MIT license.
* Licensed under the MIT license.
*/
*/
...
@@ -21,48 +21,52 @@
...
@@ -21,48 +21,52 @@
}
}
// These methods connect QUnit to PhantomJS.
// These methods connect QUnit to PhantomJS.
QUnit
.
log
=
function
(
obj
)
{
QUnit
.
log
(
function
(
obj
)
{
// What is this I don’t even
// What is this I don’t even
if
(
obj
.
message
===
'
[object Object], undefined:undefined
'
)
{
return
}
if
(
obj
.
message
===
'
[object Object], undefined:undefined
'
)
{
return
}
// Parse some stuff before sending it.
// Parse some stuff before sending it.
var
actual
=
QUnit
.
jsDump
.
parse
(
obj
.
actual
)
var
actual
var
expected
=
QUnit
.
jsDump
.
parse
(
obj
.
expected
)
var
expected
if
(
!
obj
.
result
)
{
// Dumping large objects can be very slow, and the dump isn't used for
// passing tests, so only dump if the test failed.
actual
=
QUnit
.
jsDump
.
parse
(
obj
.
actual
)
expected
=
QUnit
.
jsDump
.
parse
(
obj
.
expected
)
}
// Send it.
// Send it.
sendMessage
(
'
qunit.log
'
,
obj
.
result
,
actual
,
expected
,
obj
.
message
,
obj
.
source
)
sendMessage
(
'
qunit.log
'
,
obj
.
result
,
actual
,
expected
,
obj
.
message
,
obj
.
source
)
}
}
)
QUnit
.
testStart
=
function
(
obj
)
{
QUnit
.
testStart
(
function
(
obj
)
{
sendMessage
(
'
qunit.testStart
'
,
obj
.
name
)
sendMessage
(
'
qunit.testStart
'
,
obj
.
name
)
}
}
)
QUnit
.
testDone
=
function
(
obj
)
{
QUnit
.
testDone
(
function
(
obj
)
{
sendMessage
(
'
qunit.testDone
'
,
obj
.
name
,
obj
.
failed
,
obj
.
passed
,
obj
.
total
)
sendMessage
(
'
qunit.testDone
'
,
obj
.
name
,
obj
.
failed
,
obj
.
passed
,
obj
.
total
,
obj
.
duration
)
}
}
)
QUnit
.
moduleStart
=
function
(
obj
)
{
QUnit
.
moduleStart
(
function
(
obj
)
{
sendMessage
(
'
qunit.moduleStart
'
,
obj
.
name
)
sendMessage
(
'
qunit.moduleStart
'
,
obj
.
name
)
}
}
)
QUnit
.
begin
=
function
()
{
QUnit
.
moduleDone
(
function
(
obj
)
{
sendMessage
(
'
qunit.begin
'
)
if
(
obj
.
failed
===
0
)
{
console
.
log
(
'
Starting test suite
'
)
console
.
log
(
'
\r\
u2714 All tests passed in "
'
+
obj
.
name
+
'
" module
'
)
console
.
log
(
'
================================================
\n
'
)
}
QUnit
.
moduleDone
=
function
(
opts
)
{
if
(
opts
.
failed
===
0
)
{
console
.
log
(
'
\r\
u2714 All tests passed in "
'
+
opts
.
name
+
'
" module
'
)
}
else
{
}
else
{
console
.
log
(
'
\
u2716
'
+
o
pts
.
failed
+
'
tests failed in "
'
+
opts
.
name
+
'
" module
'
)
console
.
log
(
'
\
u2716
'
+
o
bj
.
failed
+
'
tests failed in "
'
+
obj
.
name
+
'
" module
'
)
}
}
sendMessage
(
'
qunit.moduleDone
'
,
o
pts
.
name
,
opts
.
failed
,
opts
.
passed
,
opts
.
total
)
sendMessage
(
'
qunit.moduleDone
'
,
o
bj
.
name
,
obj
.
failed
,
obj
.
passed
,
obj
.
total
)
}
}
)
QUnit
.
done
=
function
(
opts
)
{
QUnit
.
begin
(
function
()
{
console
.
log
(
'
\n
================================================
'
)
sendMessage
(
'
qunit.begin
'
)
console
.
log
(
'
Tests completed in
'
+
opts
.
runtime
+
'
milliseconds
'
)
console
.
log
(
'
\n\n
Starting test suite
'
)
console
.
log
(
opts
.
passed
+
'
tests of
'
+
opts
.
total
+
'
passed,
'
+
opts
.
failed
+
'
failed.
'
)
console
.
log
(
'
================================================
\n
'
)
sendMessage
(
'
qunit.done
'
,
opts
.
failed
,
opts
.
passed
,
opts
.
total
,
opts
.
runtime
)
})
}
QUnit
.
done
(
function
(
obj
)
{
sendMessage
(
'
qunit.done
'
,
obj
.
failed
,
obj
.
passed
,
obj
.
total
,
obj
.
runtime
)
})
}())
}())
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