From f8ebf581f8272615f48ce355c6b2cbf8248c73bd Mon Sep 17 00:00:00 2001 From: eug-vs Date: Wed, 2 Dec 2020 15:26:25 +0300 Subject: feat: export client class --- test/scheduler.test.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'test/scheduler.test.ts') diff --git a/test/scheduler.test.ts b/test/scheduler.test.ts index ffcd623..1736ed4 100644 --- a/test/scheduler.test.ts +++ b/test/scheduler.test.ts @@ -1,12 +1,12 @@ import { expect } from 'chai'; import Scheduler from '../lib/scheduler'; -import Model, { CustomEvent } from './model'; -import connection from './utils/dbConnection'; +import client, { Event } from './client'; +const Model = client.Event; const sleep = async (time: number) => new Promise(res => setTimeout(res, time)); describe('Scheduler', async () => { - let event: CustomEvent; + let event: Event; let scheduler: Scheduler; beforeEach(() => { @@ -28,14 +28,14 @@ describe('Scheduler', async () => { }); after(async () => { - connection.dropCollection('customevents'); + client.connection.dropCollection('events'); }); it('Should run event', async () => { // Wait until job is run await new Promise(res => { - scheduler.registerHandler('test', async (event: CustomEvent) => { + scheduler.registerHandler('test', async (event: Event) => { await sleep(2000); await event.log(event.context.message) res(); -- cgit v1.2.3