From 569cb0457b4cdcffdf325bdfe8959d55e48efc25 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Fri, 4 Dec 2020 01:12:54 +0300 Subject: feat!: remove context schema from client This will allow for multiple event types in one Model. --- test/client.ts | 14 +------------- test/scheduler.test.ts | 10 +++++++++- 2 files changed, 10 insertions(+), 14 deletions(-) (limited to 'test') 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; - -const contextSchema = new Schema({ - message: String -}); - -const client = new Client(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; + const Model = client.Event; const sleep = async (time: number) => new Promise(res => setTimeout(res, time)); -- cgit v1.2.3