54 lines
3.0 KiB
JavaScript
54 lines
3.0 KiB
JavaScript
"use strict";// import * as WebSocket from 'ws';
|
|
// import ClientBase from '../clients/clientBase';
|
|
// import MHSClient from '../clients/sites/mhsClient';
|
|
// import ClientManager from '../clientManager';
|
|
// var expect = require('chai').expect;
|
|
// var assert = require('chai').assert;
|
|
// var sinon = require('sinon');
|
|
// var name: string = 'test channel';
|
|
// var data: any = { 'client': 'test', 'client_type':'site', 'user_id': 125, 'user_type': 'user', 'channel': name }
|
|
// var WebSocketClient = require('websocket').client;
|
|
// var wsClient = new WebSocketClient();
|
|
// var client: ClientBase = new ClientBase(data, wsClient);
|
|
// let clientManager = new ClientManager();
|
|
// describe('ClientManager', function () {
|
|
// it('should add a client', function () {
|
|
// var result = clientManager.addClient(data, wsClient);
|
|
// expect(result.id).to.be.equal(125);
|
|
// });
|
|
// it('should get clients of type', function () {
|
|
// var result = clientManager.clientsOfType('site');
|
|
// assert(result.length > 0, 'returns one client');
|
|
// });
|
|
// it('should see client exists', function () {
|
|
// var exists = clientManager.clientExists(data.user_id);
|
|
// var result = exists ? true : false;
|
|
// expect(result).to.be.equal(true);
|
|
// });
|
|
// it('should see client does not exists', function () {
|
|
// var exists = clientManager.clientExists(200);
|
|
// var result = exists ? true : false;
|
|
// expect(result).to.be.equal(false);
|
|
// });
|
|
// it('should get an existing client', function () {
|
|
// var exists = clientManager.getClient(data.user_id);
|
|
// var result = exists ? true : false;
|
|
// expect(result).to.be.equal(true);
|
|
// });
|
|
// it('should not get an existing client', function () {
|
|
// var exists = clientManager.getClient(200);
|
|
// var result = exists ? true : false;
|
|
// expect(result).to.be.equal(false);
|
|
// });
|
|
// it('should add client of type MHSClient', function () {
|
|
// var data: any = { 'client': 'mhs', 'client_type':'site', 'user_id': 125, 'user_type': 'user', 'channel': name }
|
|
// var result = clientManager.getClientType(data, wsClient);
|
|
// expect(result.clientType()).to.be.equal('mhs');
|
|
// });
|
|
// // it('should remove a client', function () {
|
|
// // clientManager.removeClient(data.user_id);
|
|
// // expect(clientManager.clients.length).to.be.equal(0);
|
|
// // });
|
|
// });
|
|
//# sourceMappingURL=clientManager.spec.js.map
|
|
var cov_1wd6f9mhef=function(){var path="/Users/josh.burman/Projects/braid/dist/server/test/clientManager.spec.js";var hash="58341126b5dbf87407cd4141f560d34c63bb7c65";var Function=function(){}.constructor;var global=new Function("return this")();var gcv="__coverage__";var coverageData={path:"/Users/josh.burman/Projects/braid/dist/server/test/clientManager.spec.js",statementMap:{},fnMap:{},branchMap:{},s:{},f:{},b:{},_coverageSchema:"43e27e138ebf9cfc5966b082cf9a028302ed4184"};var coverage=global[gcv]||(global[gcv]={});if(coverage[path]&&coverage[path].hash===hash){return coverage[path];}coverageData.hash=hash;return coverage[path]=coverageData;}(); |