@pryv/monitor 2.3.8 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pryv/monitor",
3
- "version": "2.3.8",
3
+ "version": "2.3.9",
4
4
  "description": "Extends `pryv` with event-driven notifications for changes on a Pryv.io account",
5
5
  "keywords": [
6
6
  "Pryv",
@@ -7,10 +7,10 @@
7
7
  require('./load-helpers');
8
8
 
9
9
  describe('Monitor', function () {
10
- this.timeout(3000);
10
+ this.timeout(20000);
11
11
 
12
12
  before(async function () {
13
- this.timeout(5000);
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, 2000));
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, 2000));
92
+ await new Promise(resolve => setTimeout(resolve, 8000));
93
93
  expect(count).to.be.gt(0);
94
94
  });
95
95
  });
@@ -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(3000);
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(5000);
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, 1000));
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, 2000));
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(4000);
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, 1000));
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, 1000));
76
+ await new Promise(resolve => setTimeout(resolve, 6000));
77
77
  expect(count).to.equal(0);
78
78
  });
79
79
  });
@@ -7,7 +7,7 @@
7
7
  require('./load-helpers');
8
8
 
9
9
  describe('Monitor + EventsTimer', function () {
10
- this.timeout(3000);
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, 2000));
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(4000);
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, 1000));
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, 1000));
90
+ await new Promise(resolve => setTimeout(resolve, 5000));
91
91
  expect(count).to.equal(0);
92
92
  });
93
93
  });