Skip to content

Commit

Permalink
Remove the server side test
Browse files Browse the repository at this point in the history
  • Loading branch information
sulkaharo committed Jan 1, 2020
1 parent 44519b9 commit 9817b03
Showing 1 changed file with 0 additions and 27 deletions.
27 changes: 0 additions & 27 deletions tests/timeago.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,33 +43,6 @@ describe('timeago', function() {
done();
});

it('should suspend alarms due to hibernation when 2 heartbeats are skipped on server', function() {
ctx.ddata.sgvs = [{ mills: Date.now() - times.mins(16).msecs, mgdl: 100, type: 'sgv' }];

var sbx = freshSBX()
var status = timeago.checkStatus(sbx);
// By default (no hibernation detected) a warning should be given
// we force no hibernation by checking status twice
status = timeago.checkStatus(sbx);
should.equal(status, 'warn');

// 10ms more than suspend-threshold to prevent flapping tests
var timeoutMs = 2 * ctx.settings.heartbeat * 1000 + 100;
return new Promise(function(resolve, reject) {
setTimeout(function() {
status = timeago.checkStatus(sbx);
// Because hibernation should now be detected, no warning should be given
should.equal(status, 'current');

// We immediately ask status again, so hibernation should not be detected anymore,
// and we should receive a warning again
status = timeago.checkStatus(sbx);
should.equal(status, 'warn');

resolve()
}, timeoutMs)
})
});

it('should trigger a warning when data older than 15m', function(done) {
ctx.notifications.initRequests();
Expand Down

0 comments on commit 9817b03

Please sign in to comment.