I am currently working on a project called Cloak, which is a network layer for multiplayer HTML5 games that handles lobbies, rooms, chat, reconnection to games, and so on. Cloak has both a client and a server component and handles all the communication between them. Traditionally this would be a huge hassle to write automated tests for, but Node.js has made it easy. Our tests use Nodeunit to run the actual Cloak server and actual Cloak clients at the same time! For example, one test configures a server to automatically create rooms when two users connect, then fires up two clients, connects them both, and confirms that a new room was created for them.
I have always been in favor of writing the types of tests that are most valuable for the application they’re testing. What I just described might be called integration testing(as opposed to unit testing), and to me that is exactly the kind of testing Cloak needs in order to really build confidence in the correctness of the library. Integration testing can be quite challenging on many platforms. Consequently, I’m all the more pleased with my results doing integration testing for Cloak.
Your new post is loading...