Release 1.4.0

This commit is contained in:
2022-08-13 10:20:06 +02:00
parent 9bb72f0207
commit 5452306c72
162 changed files with 10015 additions and 4419 deletions

View File

@@ -1,14 +1,14 @@
import * as WebSocketLib from 'src/lib/websocket';
describe('src/lib/websocket', () => {
describe('HomeHubWebSocket', () => {
describe('BaseConnector', () => {
const settings = {
url: '/websocket',
spam: true,
};
it('includes the subscribable mixin', () => {
// Given
const webSocket = new WebSocketLib.HomeHubWebSocket(false, settings);
const webSocket = new WebSocketLib.BaseConnector(false, settings);
// Then
expect(webSocket.__mixins__).toContain('SubscribableMixin');
@@ -16,7 +16,7 @@ describe('src/lib/websocket', () => {
it('includes the event source mixin', () => {
// Given
const webSocket = new WebSocketLib.HomeHubWebSocket(false, settings);
const webSocket = new WebSocketLib.BaseConnector(false, settings);
// Then
expect(webSocket.__mixins__).toContain('EventSourceMixin');
@@ -25,14 +25,11 @@ describe('src/lib/websocket', () => {
describe('constructor', () => {
it('initializes the instance', () => {
// Given
const webSocket = new WebSocketLib.HomeHubWebSocket(false, settings);
const webSocket = new WebSocketLib.BaseConnector(false, settings);
// Then
expect(webSocket.debug).toBe(false);
expect(webSocket.settings).toEqual(settings);
expect(webSocket.socket).toBe(null);
expect(webSocket.reconnectTimeout).toBe(null);
expect(webSocket.reconnectCounter).toEqual(0);
});
});
@@ -63,6 +60,24 @@ describe('src/lib/websocket', () => {
expect(console.log).not.toHaveBeenCalled(); // eslint-disable-line no-console
});
});
});
describe('HomeHubWebSocket', () => {
const settings = {
url: '/websocket',
};
describe('constructor', () => {
it('initializes the instance', () => {
// Given
const webSocket = new WebSocketLib.HomeHubWebSocket(false, settings);
// Then
expect(webSocket.socket).toBe(null);
expect(webSocket.reconnectTimeout).toBe(null);
expect(webSocket.reconnectCounter).toEqual(0);
});
});
describe('stopReconnect', () => {
beforeEach(() => {