Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
casperjs
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
90bec9fa
...
90bec9fa178dedd7f9223c274ac47715587c58c3
authored
2012-12-27 00:34:42 +0100
by
Nicolas Perriault
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fixed tests, jshint
1 parent
6e35765f
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
7 additions
and
4 deletions
.jshintignore
modules/tester.js
modules/utils.js
modules/xunit.js
tests/suites/xunit.js
.jshintignore
View file @
90bec9f
...
...
@@ -5,3 +5,4 @@ modules/querystring.js
samples
tests/site
tests/testdir
tmp
...
...
modules/tester.js
View file @
90bec9f
...
...
@@ -36,6 +36,7 @@ var utils = require('utils');
var
f
=
utils
.
format
;
function
AssertionError
(
msg
,
result
)
{
"use strict"
;
Error
.
call
(
this
);
this
.
message
=
msg
;
this
.
name
=
'AssertionError'
;
...
...
@@ -829,7 +830,7 @@ Tester.prototype.done = function done(planned) {
if
(
arguments
.
length
>
0
)
{
this
.
casper
.
warn
(
'done() `planned` arg is deprecated as of 1.1'
);
}
if
(
this
.
currentSuite
.
planned
&&
this
.
currentSuite
.
planned
!==
this
.
executed
)
{
if
(
this
.
currentSuite
&&
this
.
currentSuite
.
planned
!==
this
.
executed
)
{
this
.
dubious
(
this
.
currentSuite
.
planned
,
this
.
executed
);
}
else
if
(
planned
&&
planned
!==
this
.
executed
)
{
this
.
dubious
(
planned
,
this
.
executed
);
...
...
@@ -1393,6 +1394,7 @@ TestCaseResult.prototype.addSuccess = function addSuccess(success, time) {
* @param Object warning
*/
TestCaseResult
.
prototype
.
addWarning
=
function
addWarning
(
warning
)
{
"use strict"
;
warning
.
suite
=
this
.
name
;
this
.
warnings
.
push
(
warning
);
};
...
...
modules/utils.js
View file @
90bec9f
...
...
@@ -216,7 +216,7 @@ function formatTestValue(value, name) {
}
else
if
(
name
===
'stack'
)
{
if
(
isArray
(
value
))
{
formatted
+=
value
.
map
(
function
(
entry
)
{
return
format
(
'in %s() in %s:%d'
,
(
entry
.
function
||
"anonymous"
),
entry
.
file
,
entry
.
line
);
return
format
(
'in %s() in %s:%d'
,
(
entry
[
'function'
]
||
"anonymous"
),
entry
.
file
,
entry
.
line
);
}).
join
(
'\n'
);
}
else
{
formatted
+=
'not provided'
;
...
...
modules/xunit.js
View file @
90bec9f
...
...
@@ -102,7 +102,7 @@ XUnitExporter.prototype.getXML = function getXML() {
tests
:
result
.
assertions
,
failures
:
result
.
failures
.
length
,
time
:
utils
.
ms2seconds
(
result
.
calculateDuration
()),
'package'
:
generateClassName
(
result
.
file
)
,
'package'
:
generateClassName
(
result
.
file
)
});
result
.
passes
.
forEach
(
function
(
success
)
{
var
testCase
=
utils
.
node
(
'testcase'
,
{
...
...
tests/suites/xunit.js
View file @
90bec9f
/*global casper*/
/*global casper
__utils__
*/
/*jshint strict:false*/
var
tester
=
require
(
'tester'
);
var
testpage
=
require
(
'webpage'
).
create
();
...
...
Please
register
or
sign in
to post a comment