Last active
August 29, 2015 14:10
-
-
Save SBejga/e9b110fde33075df7d1b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//make + mocker + jasmine | |
it('should register component (single ID)', function(done) { | |
socket = io('http://localhost:' + port); | |
socketService.io.sockets.in('component1').emit('foobar', { foo: 'baz' }); | |
socket.once('registerComponent', function(data) { | |
socketService.io.sockets.in('component1').emit('foobar', { foo: 'bar' }); | |
}); | |
socket.once('foobar', function(data) { | |
data.should.eql({ | |
foo: 'bar' | |
}, 'Socket got component broadcast before registering!'); | |
done(); | |
}); | |
socket.emit('registerComponent', { | |
id: 1 | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment