Skip to content

Instantly share code, notes, and snippets.

@incompl
Created September 2, 2013 17:30
Show Gist options
  • Select an option

  • Save incompl/6415318 to your computer and use it in GitHub Desktop.

Select an option

Save incompl/6415318 to your computer and use it in GitHub Desktop.
// Test basic messaging, to and from client
messageBasics: function(test) {
test.expect(2);
var server = this.server;
var client = createClient();
server.configure({
port: this.port,
messages: {
dog: function(arg, user) {
test.equals(arg.foo, 123);
user.message('cat', {bar: 456});
}
}
});
client.configure({
serverEvents: {
begin: function() {
client.message('dog', {foo: 123});
}
},
messages: {
cat: function(arg) {
test.equals(arg.bar, 456);
test.done();
}
}
});
server.run();
client.run(this.host);
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment