diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/client.ts | 14 | ||||
-rw-r--r-- | test/scheduler.test.ts | 10 |
2 files changed, 10 insertions, 14 deletions
diff --git a/test/client.ts b/test/client.ts index 182859b..5f96339 100644 --- a/test/client.ts +++ b/test/client.ts @@ -1,19 +1,7 @@ -import { Schema } from 'mongoose'; import { Client } from '../lib'; -import { Event as EventBase } from '../lib/event.model'; import connection from './utils/dbConnection'; -interface Context { - message: string; -} - -export type Event = EventBase<Context>; - -const contextSchema = new Schema({ - message: String -}); - -const client = new Client<Context>(connection, contextSchema); +const client = new Client(connection); export default client; diff --git a/test/scheduler.test.ts b/test/scheduler.test.ts index 1736ed4..c341cc8 100644 --- a/test/scheduler.test.ts +++ b/test/scheduler.test.ts @@ -1,6 +1,14 @@ import { expect } from 'chai'; import Scheduler from '../lib/scheduler'; -import client, { Event } from './client'; +import { Event as EventBase } from '../lib/event.model'; +import client from './client'; + +interface Context { + message: string; +} + +type Event = EventBase<Context>; + const Model = client.Event; const sleep = async (time: number) => new Promise<void>(res => setTimeout(res, time)); |