Skip to content

Commit 206f964

Browse files
committed
resolve conflicts for 1.0
1 parent 977c46e commit 206f964

File tree

4 files changed

+8
-1
lines changed

4 files changed

+8
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ angular.module('app')
164164
### 1.0.0
165165
* Upgraded to work with latest angular.
166166
* Use 0.1.0 with older versions of angularjs.
167+
* Add `once` support
167168

168169
### 0.1.0
169170
* Fixed issue interface with the latest angular package.

angular-socket.io-mock.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ ng.provider('socketFactory',function(){
1313
this.events[eventName].push(callback);
1414
};
1515

16+
// intercept 'once' calls and treat them as 'on'
17+
obj.once = obj.on;
18+
1619
// intercept 'emit' calls from the client and record them to assert against in the test
1720
obj.emit = function(eventName){
1821
var args = Array.prototype.slice.call(arguments,1);

angular-socket.io-mock.spec.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ describe('Angular Socket.io Mock',function(){
66
it('should be able to listen on an event',inject(function(socketFactory){
77
expect(new socketFactory().on('test-event',function(){})).not.toBe(false)
88
}))
9+
it('should be able to listen once event',inject(function(socketFactory){
10+
expect(socketFactory.once('test-event',function(){})).not.toBe(false)
11+
}))
912
it('should be able to emit an event',inject(function(socketFactory){
1013
expect(new socketFactory().emit('test-event',{})).not.toBe(false)
1114
}))

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-socket.io-mock",
3-
"version": "0.1.0",
3+
"version": "0.1.1",
44
"dependencies": {
55
"angular": "latest",
66
"angular-socket-io": "latest"

0 commit comments

Comments
 (0)