Commit 4ae419ad 4ae419ade75a27d2a6e948de22e08870a6c3cc18 by mickaelandrieu

Added tests

1 parent 527fe8a8
...@@ -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 });
......