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
b1b5d0e4
...
b1b5d0e47bcd0e6061037f9d6083c5546614137b
authored
2012-01-12 09:41:40 +0100
by
Nicolas Perriault
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
added more tests for events
1 parent
f7ca4ea2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
tests/suites/casper/events.js
tests/suites/casper/events.js
View file @
b1b5d0e
// events
casper
.
test
.
comment
(
"events"
);
casper
.
plopped
=
false
;
casper
.
on
(
"plop"
,
function
()
{
this
.
plopped
=
true
;
});
casper
.
test
.
assert
(
Object
.
keys
(
casper
.
_events
).
some
(
function
(
i
)
{
return
i
===
"plop"
;
}),
"on() has set an event handler"
);
casper
.
emit
(
"plop"
);
casper
.
test
.
assert
(
casper
.
plopped
,
"emit() emits an event"
);
// filters
casper
.
test
.
comment
(
"filters"
);
casper
.
foo
=
0
;
casper
.
setFilter
(
"test"
,
function
(
a
)
{
this
.
foo
=
42
;
...
...
Please
register
or
sign in
to post a comment