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
7d0b40a5
...
7d0b40a5fb2ee2ed2ae0ec6c6d1680e57c012070
authored
2012-10-25 12:59:34 +0200
by
Nicolas Perriault
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fixes #260 - Don't display test error messages when not testing
1 parent
c55dc1bc
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
0 deletions
bin/bootstrap.js
modules/tester.js
bin/bootstrap.js
View file @
7d0b40a
...
...
@@ -269,6 +269,7 @@ function bootstrap(global) {
phantom
.
exit
(
0
);
}
else
if
(
phantom
.
casperArgs
.
get
(
0
)
===
"test"
)
{
phantom
.
casperScript
=
fs
.
absolute
(
fs
.
pathJoin
(
phantom
.
casperPath
,
'tests'
,
'run.js'
));
phantom
.
casperTest
=
true
;
phantom
.
casperArgs
.
drop
(
"test"
);
}
else
if
(
phantom
.
casperArgs
.
get
(
0
)
===
"selftest"
)
{
phantom
.
casperScript
=
fs
.
absolute
(
fs
.
pathJoin
(
phantom
.
casperPath
,
'tests'
,
'run.js'
));
...
...
modules/tester.js
View file @
7d0b40a
...
...
@@ -610,9 +610,19 @@ Tester.prototype.comment = function comment(message) {
this
.
casper
.
echo
(
'# '
+
message
,
'COMMENT'
);
};
/**
* Configure casper callbacks for testing purpose.
*
*/
Tester
.
prototype
.
configure
=
function
configure
()
{
"use strict"
;
var
tester
=
this
;
// Do not hook casper if we're not testing
if
(
!
phantom
.
casperTest
)
{
return
;
}
// specific timeout callbacks
this
.
casper
.
options
.
onStepTimeout
=
function
test_onStepTimeout
(
timeout
,
step
)
{
tester
.
fail
(
f
(
"Step timeout occured at step %d (%dms)"
,
step
,
timeout
));
...
...
Please
register
or
sign in
to post a comment