@pryv/monitor 2.3.7 → 2.3.9
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 +1 -1
- package/src/index.js +1 -1
- package/test/monitor.test.js +4 -4
- package/test/socket.test.js +7 -7
- package/test/timer.test.js +5 -5
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -35,7 +35,7 @@ module.exports = function (pryv) {
|
|
|
35
35
|
*/
|
|
36
36
|
|
|
37
37
|
/**
|
|
38
|
-
* A scope corresponding to EventGetParameters @see https://l.
|
|
38
|
+
* A scope corresponding to EventGetParameters @see https://l.backloop.dev:4443/reference#get-events
|
|
39
39
|
* Property `limit` cannot be specified;
|
|
40
40
|
* @typedef {Object} pryv.Monitor.Scope
|
|
41
41
|
* @property {timestamp} [fromTime=TIMERANGE_MIN] (in seconds)
|
package/test/monitor.test.js
CHANGED
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
require('./load-helpers');
|
|
8
8
|
|
|
9
9
|
describe('Monitor', function () {
|
|
10
|
-
this.timeout(
|
|
10
|
+
this.timeout(20000);
|
|
11
11
|
|
|
12
12
|
before(async function () {
|
|
13
|
-
this.timeout(
|
|
13
|
+
this.timeout(20000);
|
|
14
14
|
await prepareAndCreateBaseStreams();
|
|
15
15
|
});
|
|
16
16
|
|
|
@@ -64,7 +64,7 @@ describe('Monitor', function () {
|
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
]);
|
|
67
|
-
await new Promise(resolve => setTimeout(resolve,
|
|
67
|
+
await new Promise(resolve => setTimeout(resolve, 8000));
|
|
68
68
|
expect(count).to.be.gt(0);
|
|
69
69
|
});
|
|
70
70
|
|
|
@@ -89,7 +89,7 @@ describe('Monitor', function () {
|
|
|
89
89
|
}
|
|
90
90
|
]);
|
|
91
91
|
await monitor.updateEvents(); // trigger refresh
|
|
92
|
-
await new Promise(resolve => setTimeout(resolve,
|
|
92
|
+
await new Promise(resolve => setTimeout(resolve, 8000));
|
|
93
93
|
expect(count).to.be.gt(0);
|
|
94
94
|
});
|
|
95
95
|
});
|
package/test/socket.test.js
CHANGED
|
@@ -8,14 +8,14 @@ require('./load-helpers');
|
|
|
8
8
|
require('@pryv/socket.io')(pryv);
|
|
9
9
|
|
|
10
10
|
describe('Monitor + Socket.IO', function () {
|
|
11
|
-
this.timeout(
|
|
11
|
+
this.timeout(20000);
|
|
12
12
|
|
|
13
13
|
before(async () => {
|
|
14
14
|
await prepareAndCreateBaseStreams();
|
|
15
15
|
});
|
|
16
16
|
|
|
17
17
|
describe('socket updates', function () {
|
|
18
|
-
this.timeout(
|
|
18
|
+
this.timeout(25000);
|
|
19
19
|
it('Detect new events added', async function () {
|
|
20
20
|
const monitor = new pryv.Monitor(apiEndpoint, { limit: 1 })
|
|
21
21
|
.addUpdateMethod(new pryv.Monitor.UpdateMethod.Socket());
|
|
@@ -33,7 +33,7 @@ describe('Monitor + Socket.IO', function () {
|
|
|
33
33
|
expect(event.content).to.equal(eventData.content);
|
|
34
34
|
count++;
|
|
35
35
|
});
|
|
36
|
-
await new Promise(resolve => setTimeout(resolve,
|
|
36
|
+
await new Promise(resolve => setTimeout(resolve, 6000));
|
|
37
37
|
await conn.api([
|
|
38
38
|
{
|
|
39
39
|
method: 'events.create',
|
|
@@ -41,7 +41,7 @@ describe('Monitor + Socket.IO', function () {
|
|
|
41
41
|
}
|
|
42
42
|
]);
|
|
43
43
|
|
|
44
|
-
await new Promise(resolve => setTimeout(resolve,
|
|
44
|
+
await new Promise(resolve => setTimeout(resolve, 8000));
|
|
45
45
|
monitor.stop();
|
|
46
46
|
expect(count).to.be.gt(0);
|
|
47
47
|
});
|
|
@@ -49,12 +49,12 @@ describe('Monitor + Socket.IO', function () {
|
|
|
49
49
|
|
|
50
50
|
describe('stop', () => {
|
|
51
51
|
it('Monitor stops when requested', async function () {
|
|
52
|
-
this.timeout(
|
|
52
|
+
this.timeout(20000);
|
|
53
53
|
const monitor = new pryv.Monitor(apiEndpoint, { limit: 1 })
|
|
54
54
|
.addUpdateMethod(new pryv.Monitor.UpdateMethod.Socket());
|
|
55
55
|
await monitor.start();
|
|
56
56
|
let count = 0;
|
|
57
|
-
await new Promise(resolve => setTimeout(resolve,
|
|
57
|
+
await new Promise(resolve => setTimeout(resolve, 4000));
|
|
58
58
|
monitor.stop();
|
|
59
59
|
|
|
60
60
|
const eventData = {
|
|
@@ -73,7 +73,7 @@ describe('Monitor + Socket.IO', function () {
|
|
|
73
73
|
}
|
|
74
74
|
]);
|
|
75
75
|
|
|
76
|
-
await new Promise(resolve => setTimeout(resolve,
|
|
76
|
+
await new Promise(resolve => setTimeout(resolve, 6000));
|
|
77
77
|
expect(count).to.equal(0);
|
|
78
78
|
});
|
|
79
79
|
});
|
package/test/timer.test.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
require('./load-helpers');
|
|
8
8
|
|
|
9
9
|
describe('Monitor + EventsTimer', function () {
|
|
10
|
-
this.timeout(
|
|
10
|
+
this.timeout(20000);
|
|
11
11
|
|
|
12
12
|
before(async () => {
|
|
13
13
|
await prepareAndCreateBaseStreams();
|
|
@@ -52,7 +52,7 @@ describe('Monitor + EventsTimer', function () {
|
|
|
52
52
|
}
|
|
53
53
|
]);
|
|
54
54
|
|
|
55
|
-
await new Promise(resolve => setTimeout(resolve,
|
|
55
|
+
await new Promise(resolve => setTimeout(resolve, 4000));
|
|
56
56
|
monitor.stop();
|
|
57
57
|
expect(count).to.be.gt(0);
|
|
58
58
|
});
|
|
@@ -60,13 +60,13 @@ describe('Monitor + EventsTimer', function () {
|
|
|
60
60
|
|
|
61
61
|
describe('stop', () => {
|
|
62
62
|
it('Monitor stops when requested', async function () {
|
|
63
|
-
this.timeout(
|
|
63
|
+
this.timeout(20000);
|
|
64
64
|
const monitor = await new pryv.Monitor(apiEndpoint, { limit: 1 })
|
|
65
65
|
.addUpdateMethod(new pryv.Monitor.UpdateMethod.EventsTimer(1));
|
|
66
66
|
await monitor.start();
|
|
67
67
|
|
|
68
68
|
let count = 0;
|
|
69
|
-
await new Promise(resolve => setTimeout(resolve,
|
|
69
|
+
await new Promise(resolve => setTimeout(resolve, 4000));
|
|
70
70
|
monitor.stop();
|
|
71
71
|
|
|
72
72
|
// listener is added "after" so we don't get events loaded at start
|
|
@@ -87,7 +87,7 @@ describe('Monitor + EventsTimer', function () {
|
|
|
87
87
|
}
|
|
88
88
|
]);
|
|
89
89
|
|
|
90
|
-
await new Promise(resolve => setTimeout(resolve,
|
|
90
|
+
await new Promise(resolve => setTimeout(resolve, 5000));
|
|
91
91
|
expect(count).to.equal(0);
|
|
92
92
|
});
|
|
93
93
|
});
|