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
4409d91f
...
4409d91f3a5b30ba69dad7d3eebd7390c075e7a4
authored
2013-02-18 22:57:48 +0100
by
Nicolas Perriault
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
simpler casper error handling in tests
1 parent
e7eaeea1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
9 deletions
modules/tester.js
modules/tester.js
View file @
4409d91
...
...
@@ -143,16 +143,11 @@ var Tester = function Tester(casper, options) {
// casper events
this
.
casper
.
on
(
'error'
,
function
onCasperError
(
msg
,
backtrace
)
{
var
type
=
'error'
,
message
=
msg
,
match
=
/^
(\w
+
)
Error:
(
.*
)
/
.
exec
(
msg
);
if
(
match
)
{
type
=
match
[
1
].
toLowerCase
();
message
=
match
[
2
];
}
if
(
type
!==
'assertion'
)
{
return
this
.
test
.
uncaughtError
(
msg
,
this
.
currentTestFile
,
null
,
backtrace
);
if
(
/^AssertionError/
.
test
(
msg
))
{
return
;
}
this
.
test
.
fail
(
m
essage
,
{
type
:
type
,
this
.
test
.
fail
(
m
sg
,
{
type
:
"error"
,
doThrow
:
false
,
values
:
{
stack
:
backtrace
...
...
Please
register
or
sign in
to post a comment