Files
panic-server/test/mock.js
Jesse Gibson 4edd691277 Customized eslint, use mocha instead, implement client
filters/exclusions, all tests passing.

Eslint came with these nasty notions about alphabetizing your variable
definitions. Strict enforcement has been enabled, and empty functions
are now allowed (noop, and it was causing noise while developing).

The tests are now using mocha instead of jasmine, as I'm trying to
become more familiar with it.

The clientList is now dynamically controlled. Only connected peers are
shown, and add/remove events are fired as things change. You can now
filter a client set against criteria (platform, generic callback) and
return a new list of live updating clients, subscribed to changes on the
parent list. There's some syntax sugar also. You can create a list that
excludes another set, such as a list of browsers might be everything
that isn't a Node.js platform. You'd write that as an exclusion.

Added some basic tests for the clientList and mock logic.
2016-04-27 09:59:02 -06:00

16 lines
270 B
JavaScript

'use strict';
var Emitter = require('events');
function Client(platform) {
this.socket = new Emitter();
this.socket.connected = true;
this.socket.id = Math.random()
.toString(36)
.slice(2);
this.platform = platform || {};
}
module.exports = {
Client: Client
};