Files
panic-server/test/mock.js
Jesse Gibson c84158af0a Add editorconfig, change scripts
Editorconfig files help you keep a consistent style across projects.
Recently, I've been using it to enforce spaces over tabs (I switched).
This commit adds the config file and changes the project indent
style to match.
New script, "all-tests", runs the unit tests and the linter. The "test"
script now just refers to unit tests.
2016-11-25 15:51:26 -07:00

22 lines
390 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,
};