Skip to content

Commit

Permalink
Fix repo test setup
Browse files Browse the repository at this point in the history
  • Loading branch information
CeEv committed Jun 6, 2024
1 parent 00f6206 commit 171f586
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions apps/server/src/modules/tldraw/repo/tldraw.repo.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@ import { EntityManager } from '@mikro-orm/mongodb';
import { Test, TestingModule } from '@nestjs/testing';
import { cleanupCollections } from '@shared/testing';
import { MikroORM } from '@mikro-orm/core';
import { ConfigModule } from '@nestjs/config';
import { createConfigModuleOptions } from '@src/config';
import { tldrawEntityFactory, tldrawTestConfig } from '../testing';
import { MongoMemoryDatabaseModule } from '@src/infra/database';
import { tldrawEntityFactory } from '../testing';
import { TldrawDrawing } from '../entities';
import { TldrawRepo } from './tldraw.repo';
import { TldrawWsTestModule } from '../tldraw-ws-test.module';

describe('TldrawRepo', () => {
let testingModule: TestingModule;
Expand All @@ -17,7 +15,8 @@ describe('TldrawRepo', () => {

beforeAll(async () => {
testingModule = await Test.createTestingModule({
imports: [TldrawWsTestModule, ConfigModule.forRoot(createConfigModuleOptions(tldrawTestConfig))],
imports: [MongoMemoryDatabaseModule.forRoot({ entities: [TldrawDrawing] })],
providers: [TldrawRepo],
}).compile();

repo = testingModule.get(TldrawRepo);
Expand Down

0 comments on commit 171f586

Please sign in to comment.