It would be good to clear the log between different tests. Also `sort()` is probably not needed since the event handlers will get executed in predictable order.

It would be also good to add tests that confirm that a handler for event named "event1" won't get triggered for "event2".