cmd-control-client-lib 3.0.14 → 3.0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -47,7 +47,7 @@ describe("WebSocket connection", () => {
|
|
|
47
47
|
expect(setTimeout).toHaveBeenCalledTimes(1);
|
|
48
48
|
expect(setTimeout).toHaveBeenLastCalledWith(expect.any(Function), 15000);
|
|
49
49
|
|
|
50
|
-
const firstError =
|
|
50
|
+
const firstError = { reConnectionTimeout: 15000 };
|
|
51
51
|
expect(connectionConfig.onError).toHaveBeenCalledWith(firstError);
|
|
52
52
|
jest.runOnlyPendingTimers();
|
|
53
53
|
expect(logger.log).toHaveBeenCalledWith("CMDP. retry connect in 15000 ms");
|
|
@@ -58,7 +58,7 @@ describe("WebSocket connection", () => {
|
|
|
58
58
|
CMDConnection._socket.onerror();
|
|
59
59
|
CMDConnection._socket.onclose();
|
|
60
60
|
|
|
61
|
-
const secondError =
|
|
61
|
+
const secondError = { reConnectionTimeout: 30000 };
|
|
62
62
|
expect(setTimeout).toHaveBeenCalledTimes(2);
|
|
63
63
|
expect(setTimeout).toHaveBeenLastCalledWith(expect.any(Function), 30000);
|
|
64
64
|
expect(connectionConfig.onError).toHaveBeenCalledWith(secondError);
|
|
@@ -71,7 +71,7 @@ describe("WebSocket connection", () => {
|
|
|
71
71
|
CMDConnection._socket.onerror();
|
|
72
72
|
CMDConnection._socket.onclose();
|
|
73
73
|
|
|
74
|
-
const thirdError =
|
|
74
|
+
const thirdError = { reConnectionTimeout: 45000 };
|
|
75
75
|
expect(setTimeout).toHaveBeenCalledTimes(3);
|
|
76
76
|
expect(setTimeout).toHaveBeenLastCalledWith(expect.any(Function), 45000);
|
|
77
77
|
expect(connectionConfig.onError).toHaveBeenCalledWith(thirdError);
|
|
@@ -84,7 +84,7 @@ describe("WebSocket connection", () => {
|
|
|
84
84
|
CMDConnection._socket.onerror();
|
|
85
85
|
CMDConnection._socket.onclose();
|
|
86
86
|
|
|
87
|
-
const fourthError =
|
|
87
|
+
const fourthError = { reConnectionTimeout: 60000 };
|
|
88
88
|
expect(setTimeout).toHaveBeenCalledTimes(4);
|
|
89
89
|
expect(setTimeout).toHaveBeenLastCalledWith(expect.any(Function), 60000);
|
|
90
90
|
expect(connectionConfig.onError).toHaveBeenCalledWith(fourthError);
|
|
@@ -97,7 +97,7 @@ describe("WebSocket connection", () => {
|
|
|
97
97
|
CMDConnection._socket.onerror();
|
|
98
98
|
CMDConnection._socket.onclose();
|
|
99
99
|
|
|
100
|
-
const fifthError =
|
|
100
|
+
const fifthError = { reConnectionTimeout: 75000 };
|
|
101
101
|
expect(setTimeout).toHaveBeenCalledTimes(5);
|
|
102
102
|
expect(setTimeout).toHaveBeenLastCalledWith(expect.any(Function), 75000);
|
|
103
103
|
expect(connectionConfig.onError).toHaveBeenCalledWith(fifthError);
|
|
@@ -108,7 +108,7 @@ describe("WebSocket connection", () => {
|
|
|
108
108
|
CMDConnection._socket.onerror();
|
|
109
109
|
CMDConnection._socket.onclose();
|
|
110
110
|
|
|
111
|
-
const fatalError =
|
|
111
|
+
const fatalError = { isFatal: true };
|
|
112
112
|
expect(connectionConfig.onError).toHaveBeenCalledWith(fatalError);
|
|
113
113
|
//No more setTimeout was called
|
|
114
114
|
expect(setTimeout).toHaveBeenCalledTimes(5);
|