Added tests
Showing
1 changed file
with
16 additions
and
0 deletions
... | @@ -27,3 +27,19 @@ casper.test.begin('filters', 3, function(test) { | ... | @@ -27,3 +27,19 @@ casper.test.begin('filters', 3, function(test) { |
27 | delete casper.foo; | 27 | delete casper.foo; |
28 | test.done(); | 28 | test.done(); |
29 | }); | 29 | }); |
30 | |||
31 | casper.test.begin('events order', 2, function(test) { | ||
32 | casper.mowed = "Moo"; | ||
33 | casper.on("mow", function() { | ||
34 | this.mowed = casper.mowed + " Moo"; | ||
35 | }); | ||
36 | casper.emit("mow"); | ||
37 | test.assertEquals(casper.mowed, "Moo Moo", "mowed has the correct value"); | ||
38 | |||
39 | casper.prependListener("mow", function() { | ||
40 | this.mowed = this.mowed + " Boo"; | ||
41 | }); | ||
42 | casper.emit("mow"); | ||
43 | test.assertEquals(casper.mowed, "Moo Moo Boo Moo", "mowed has the correct value"); | ||
44 | test.done(); | ||
45 | }); | ... | ... |
-
Please register or sign in to post a comment