Node module which provides fluent testing of complex TCP servers and protocols.
This module is designed to provide developers with an extremely powerful testing framework for complex TCP servers which generally require a large amount of boilerplate code or custom test functions. This module provides a fluent, easy to use and incredibly powerful framework on which extremely complex protocols can be tested.
All these things start out with an example of how you can use the test framework. The following is an example of using node-conversation with Mocha.
var Conversation = require'conversation';describe'protocol'it'should forward messages to the correct user'port: 9119client'u1'u1sendAnd'LOGIN:user1;'expect'OK;'client'u2'u2sendAnd'LOGIN:user2;'expect'OK;'client'u3'u3sendAnd'LOGIN:user3;'expect'OK;'u1writeAnd'CHAT:user2:hello;'expect'SENT:1;'u2expect'MESSAGE:user1:hello;'u1read'RECEIVED:1;'u2writeAnd'CHAT:user3:hi;'read'SENT:2;'u3read'MESSAGE:user2:hi;'u2read'RECEIVED:2;'rundone;;;
Due to its design, it is extremely easy to automate common testing tasks (for example, login processes) by adding to the
Conversations.Client.prototype. This can help make testing systems which require setup tasks to be performed considerably easier.