tests: cleanup common variables

This commit is contained in:
Girish Ramakrishnan
2021-08-13 10:41:10 -07:00
parent aa981da43b
commit a8760f6c2c
20 changed files with 393 additions and 404 deletions

View File

@@ -6,8 +6,7 @@
'use strict';
const async = require('async'),
common = require('./common.js'),
const common = require('./common.js'),
database = require('../database.js'),
delay = require('delay'),
eventlog = require('../eventlog.js'),
@@ -15,22 +14,21 @@ const async = require('async'),
notifications = require('../notifications.js');
describe('Eventlog', function () {
before(function (done) {
async.series([
common.setup,
eventlog._clear // domain add events
], done);
const { setup, cleanup } = common;
before(setup);
after(cleanup);
let eventId;
it('clear', async function () {
await eventlog._clear();
});
after(common.cleanup);
var eventId;
it('add succeeds', async function () {
const id = await eventlog.add('some.event', { ip: '1.2.3.4' }, { appId: 'thatapp' });
expect(id).to.be.a('string');
console.log(id);
eventId = id;
});