Files
panic-server/test/mock.js
Jesse Gibson 01b3349657 Build ClientList#run on Client#run
Now, with the sparkling new client API, each client is responsible for
running their own jobs. Instead of inlining all that logic in
ClientList#run, it just dispatches the job to each client and wraps it
in Promise.all. Yay for simplicity!!!
One side effect: job IDs won't be the same across clients.
2016-10-05 08:46:31 -06:00

22 lines
380 B
JavaScript

'use strict';
var Emitter = require('events');
var Client = require('../src/Client');
function mock (platform) {
var rand = Math.random();
// Fake a socket.io socket.
var socket = new Emitter();
socket.connected = true;
socket.id = rand.toString(36).slice(2);
return new Client({
socket: socket,
platform: platform || {},
});
}
module.exports = {
Client: mock,
};