Skip to content

Commit

Permalink
🎨 Function in objects to methods
Browse files Browse the repository at this point in the history
  • Loading branch information
marvinroger committed Apr 13, 2017
1 parent fa2cbf2 commit 34135cc
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion lib/event_socket.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const EventSocket = module.exports = function(ws, query, options) {
return this._sendBuffer.add(msg);
};
this._sendBuffer = {
add: function(msg) {
add(msg) {
if (this._buffer.indexOf(msg) >= 0) {
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion test/test_peer_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const assert = require('assert');


const MockServer = { _name: '1234', httpServer: { spdyServer: {}}, log: {
emit: function() {}
emit() {}
}};
const MockSocket = function() {
EventEmitter.call(this);
Expand Down
10 changes: 5 additions & 5 deletions test/test_remote_query.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ FakeScout.prototype.init = cb => {cb();};


const mockSocket = {
on: function(){},
subscribe: function(topic, cb){
on() {},
subscribe(topic, cb) {
if(cb) {
cb();
}
},
unsubscribe: function(){}
unsubscribe() {}
};

describe('Remote queries', () => {
Expand Down Expand Up @@ -169,8 +169,8 @@ describe('Remote queries', () => {
});

const sock = {
subscribe: function(){},
on: function(ev, data){
subscribe() {},
on(ev, data) {
if(ev.indexOf('query:') === 0) {
done();
}
Expand Down
6 changes: 3 additions & 3 deletions test/test_virtual_device.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ const VirtualDevice = require('../lib/virtual_device');
const LedJSON = require('./fixture/virtual_device.json');

const mockSocket = {
on: function(){},
subscribe: function(topic, cb){
on() {},
subscribe(topic, cb) {
if(cb) {
cb();
}
},
unsubscribe: function(){}
unsubscribe() {}
};

describe('Virtual Device', () => {
Expand Down

0 comments on commit 34135cc

Please sign in to comment.