Javascript PubSub pattern testing