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
df1e5cc3
...
df1e5cc3260320156988a7adf01ad009758fe550
authored
2012-06-27 15:41:06 -0700
by
reina.sweet
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Tester testResults checking before finish.
1 parent
7db58eff
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
0 deletions
modules/tester.js
modules/tester.js
View file @
df1e5cc
...
...
@@ -68,6 +68,7 @@ var Tester = function Tester(casper, options) {
this
.
testResults
=
{
passed
:
0
,
failed
:
0
,
passes
:
[],
failures
:
[]
};
...
...
@@ -87,6 +88,7 @@ var Tester = function Tester(casper, options) {
});
this
.
on
(
'success'
,
function
onSuccess
(
success
)
{
this
.
testResults
.
passes
.
push
(
success
);
this
.
exporter
.
addSuccess
(
fs
.
absolute
(
success
.
file
),
success
.
message
);
});
...
...
@@ -563,6 +565,34 @@ var Tester = function Tester(casper, options) {
};
/**
* Retrieves current failure data and all failed cases.
*
* @return Object casedata An object containg information about cases
* @return Number casedata.length The number of failed cases
* @return Array casedata.cases An array of all the failed case objects
*/
this
.
getFailures
=
function
getFailures
()
{
return
JSON
.
parse
(
JSON
.
stringify
({
length
:
this
.
testResults
.
failed
,
cases
:
this
.
testResults
.
failures
}));
};
/**
* Retrieves current passed data and all passed cases.
*
* @return Object casedata An object containg information about cases
* @return Number casedata.length The number of passed cases
* @return Array casedata.cases An array of all the passed case objects
*/
this
.
getPasses
=
function
getPasses
()
{
return
JSON
.
parse
(
JSON
.
stringify
({
length
:
this
.
testResults
.
passed
,
cases
:
this
.
testResults
.
passes
}));
};
/**
* Writes an info-style formatted message to stdout.
*
* @param String message
...
...
Please
register
or
sign in
to post a comment