more tests, added ability to remove clients from a channel

This commit is contained in:
Josh Burman
2019-03-14 14:17:08 -04:00
parent 21f77fa4c3
commit 40691d9815
17 changed files with 316 additions and 5 deletions

View File

@ -1,2 +1,26 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const clientBase_1 = require("../clients/clientBase");
var expect = require('chai').expect;
var assert = require('chai').assert;
var sinon = require('sinon');
var name = 'test channel';
var data = { 'client': 'test', 'client_type': 'site', 'user_id': 125, 'user_type': 'user', 'channel': name };
var WebSocketClient = require('websocket').client;
var wsClient = new WebSocketClient();
var client = new clientBase_1.default(data, wsClient);
describe('ClientBase', function () {
it('should get client data', function () {
var result = client.getData();
expect(result.user_id).to.be.equal(125);
});
it('should get client type', function () {
var result = client.clientType();
expect(result).to.be.equal('test');
});
it('should get client object type', function () {
var result = client.type();
expect(result).to.be.equal('site');
});
});
//# sourceMappingURL=clientBase.spec.js.map