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
a228e553
...
a228e5534f7b11c9a9d971f90c6edb010c4d6b49
authored
2013-03-06 23:20:27 +0100
by
Julien Muetton
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Implement `Tester.skip`
1 parent
3d5b91dd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
1 deletions
modules/colorizer.js
modules/tester.js
modules/colorizer.js
View file @
a228e55
...
...
@@ -66,7 +66,9 @@ var Colorizer = function Colorizer() {
'GREEN_BAR'
:
{
fg
:
'white'
,
bg
:
'green'
,
bold
:
true
},
'RED_BAR'
:
{
fg
:
'white'
,
bg
:
'red'
,
bold
:
true
},
'INFO_BAR'
:
{
bg
:
'cyan'
,
fg
:
'white'
,
bold
:
true
},
'WARN_BAR'
:
{
bg
:
'yellow'
,
fg
:
'white'
,
bold
:
true
}
'WARN_BAR'
:
{
bg
:
'yellow'
,
fg
:
'white'
,
bold
:
true
},
'SKIP'
:
{
fg
:
'magenta'
,
bold
:
true
},
'SKIP_BAR'
:
{
bg
:
'magenta'
,
fg
:
'black'
,
bold
:
true
}
};
/**
...
...
modules/tester.js
View file @
a228e55
...
...
@@ -222,6 +222,28 @@ Tester.prototype.abort = function abort(message) {
};
/**
* Aborts current test suite.
*
* @param {String} message Warning message (optional)
*/
Tester
.
prototype
.
skip
=
function
skip
(
number
,
message
)
{
"use strict"
;
var
step
=
this
.
casper
.
step
,
steps
=
this
.
casper
.
steps
,
last
=
steps
.
length
;
if
(
message
)
{
this
.
casper
.
echo
([
this
.
casper
.
colorize
(
'SKIP'
,
'SKIP'
),
'test suite aborted: '
+
message
].
join
(
' '
));
}
this
.
casper
.
step
=
Math
.
min
(
step
+
number
,
last
);
return
this
;
};
/**
* Asserts that a condition strictly resolves to true. Also returns an
* "assertion object" containing useful informations about the test case
* results.
...
...
Please
register
or
sign in
to post a comment