mirror of https://github.com/BTCPrivate/copay.git
Add tests for block events at Socket service
This commit is contained in:
parent
e1dc275ddd
commit
970a6f3d37
|
@ -41,6 +41,14 @@ describe("Unit: Socket Service", function() {
|
||||||
expect(Object.keys(ret)).to.have.length(2);
|
expect(Object.keys(ret)).to.have.length(2);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
it('Socket should support block event', inject(function(Socket) {
|
||||||
|
expect(Socket.isListeningBlocks()).to.be.false;
|
||||||
|
Socket.on('block', function() {});
|
||||||
|
expect(Socket.isListeningBlocks()).to.be.true;
|
||||||
|
Socket.removeAllListeners();
|
||||||
|
expect(Socket.isListeningBlocks()).to.be.false;
|
||||||
|
}));
|
||||||
|
|
||||||
it('Socket should support #removeAllListeners', inject(function(Socket) {
|
it('Socket should support #removeAllListeners', inject(function(Socket) {
|
||||||
Socket.on('a', function() {});
|
Socket.on('a', function() {});
|
||||||
Socket.on('b', function() {});
|
Socket.on('b', function() {});
|
||||||
|
|
Loading…
Reference in New Issue