replace delay.js with timers/promises
This commit is contained in:
@@ -8,10 +8,10 @@
|
||||
|
||||
const common = require('./common.js'),
|
||||
database = require('../database.js'),
|
||||
delay = require('../delay.js'),
|
||||
eventlog = require('../eventlog.js'),
|
||||
expect = require('expect.js'),
|
||||
notifications = require('../notifications.js');
|
||||
notifications = require('../notifications.js'),
|
||||
timers = require('timers/promises');
|
||||
|
||||
describe('Eventlog', function () {
|
||||
const { setup, cleanup } = common;
|
||||
@@ -89,7 +89,7 @@ describe('Eventlog', function () {
|
||||
let result = await eventlog.get(loginEventId);
|
||||
const oldCreationTime = result.creationTime;
|
||||
|
||||
await delay(2000);
|
||||
await timers.setTimeout(2000);
|
||||
result = await eventlog.upsertLoginEvent('user.login', { ip: '1.2.3.4' }, { appId: 'thatapp' });
|
||||
expect(result).to.equal(loginEventId);
|
||||
|
||||
@@ -117,7 +117,7 @@ describe('Eventlog', function () {
|
||||
await notifications._add('title', 'some message', { eventId });
|
||||
}
|
||||
|
||||
await delay(3000);
|
||||
await timers.setTimeout(3000);
|
||||
|
||||
const id = await eventlog.add(eventlog.ACTION_USER_LOGIN, { ip: '1.2.3.4' }, { appId: 'thatapp' });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user