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
4ae419ad
...
4ae419ade75a27d2a6e948de22e08870a6c3cc18
authored
2013-12-16 15:05:52 +0100
by
mickaelandrieu
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Added tests
1 parent
527fe8a8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
tests/suites/casper/events.js
tests/suites/casper/events.js
View file @
4ae419a
...
...
@@ -27,3 +27,19 @@ casper.test.begin('filters', 3, function(test) {
delete
casper
.
foo
;
test
.
done
();
});
casper
.
test
.
begin
(
'events order'
,
2
,
function
(
test
)
{
casper
.
mowed
=
"Moo"
;
casper
.
on
(
"mow"
,
function
()
{
this
.
mowed
=
casper
.
mowed
+
" Moo"
;
});
casper
.
emit
(
"mow"
);
test
.
assertEquals
(
casper
.
mowed
,
"Moo Moo"
,
"mowed has the correct value"
);
casper
.
prependListener
(
"mow"
,
function
()
{
this
.
mowed
=
this
.
mowed
+
" Boo"
;
});
casper
.
emit
(
"mow"
);
test
.
assertEquals
(
casper
.
mowed
,
"Moo Moo Boo Moo"
,
"mowed has the correct value"
);
test
.
done
();
});
...
...
Please
register
or
sign in
to post a comment