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
1cd41d0d
...
1cd41d0d277cf08a6950092fd581c76e5148f389
authored
2013-02-14 10:27:31 +0100
by
Nicolas Perriault
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Optional 'planned' parameter in Tester.begin()
1 parent
1a8634f5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
5 deletions
modules/tester.js
modules/tester.js
View file @
1cd41d0
...
...
@@ -817,16 +817,32 @@ Tester.prototype.bar = function bar(text, style) {
/**
* Starts a suite.
*
* @param String description Test suite description
* @param Number planned Number of planned tests in this suite
* @param Function suiteFn Suite function
* Can be invoked two different ways:
*
* casper.test.begin("suite description", plannedTests, function(test){})
*
* Or:
*
* casper.test.begin("suite description", function(test){})
*
*/
Tester
.
prototype
.
begin
=
function
begin
(
description
,
planned
,
suiteFn
)
{
Tester
.
prototype
.
begin
=
function
begin
()
{
"use strict"
;
/*jshint maxstatements:20*/
if
(
this
.
started
&&
this
.
running
)
{
return
this
.
queue
.
push
(
arguments
);
}
description
=
description
||
"Untitled suite in "
+
this
.
currentTestFile
;
var
description
=
arguments
[
0
]
||
f
(
"Untitled suite in %s"
,
this
.
currentTestFile
),
planned
,
suiteFn
;
if
(
utils
.
isFunction
(
arguments
[
1
]))
{
suiteFn
=
arguments
[
1
];
}
else
if
(
utils
.
isNumber
(
arguments
[
1
])
&&
utils
.
isFunction
(
arguments
[
2
]))
{
planned
=
arguments
[
1
];
suiteFn
=
arguments
[
2
];
}
else
{
throw
new
CasperError
(
'Invalid call'
);
}
if
(
!
this
.
options
.
concise
)
{
this
.
comment
(
description
);
}
...
...
Please
register
or
sign in
to post a comment