]> git.proxmox.com Git - mirror_novnc.git/blobdiff - tests/test.websock.js
Add eslint and fix reported issues
[mirror_novnc.git] / tests / test.websock.js
index 5d0f82728dd9915b4e15a8a7fa44bef84c0b7244..1e978ec23ebdc1eac3a3f6060e32b71b11c3b42d 100644 (file)
@@ -1,14 +1,9 @@
-/* jshint expr: true */
-var assert = chai.assert;
 var expect = chai.expect;
 
 import Websock from '../core/websock.js';
 import FakeWebSocket from './fake.websocket.js';
 
-import './assertions';
-import 'sinon';
-import sinonChai from '../node_modules/sinon-chai/lib/sinon-chai.js';
-chai.use(sinonChai);
+import sinon from '../vendor/sinon.js';
 
 describe('Websock', function() {
     "use strict";
@@ -235,14 +230,15 @@ describe('Websock', function() {
 
         var sock;
         beforeEach(function () {
-           sock = new Websock();
-           WebSocket = sinon.spy();
-           WebSocket.OPEN = old_WS.OPEN;
-           WebSocket.CONNECTING = old_WS.CONNECTING;
-           WebSocket.CLOSING = old_WS.CLOSING;
-           WebSocket.CLOSED = old_WS.CLOSED;
-
-           WebSocket.prototype.binaryType = 'arraybuffer';
+            sock = new Websock();
+            // eslint-disable-next-line no-global-assign
+            WebSocket = sinon.spy();
+            WebSocket.OPEN = old_WS.OPEN;
+            WebSocket.CONNECTING = old_WS.CONNECTING;
+            WebSocket.CLOSING = old_WS.CLOSING;
+            WebSocket.CLOSED = old_WS.CLOSED;
+
+            WebSocket.prototype.binaryType = 'arraybuffer';
         });
 
         describe('opening', function () {
@@ -331,6 +327,7 @@ describe('Websock', function() {
         });
 
         after(function () {
+            // eslint-disable-next-line no-global-assign
             WebSocket = old_WS;
         });
     });