We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b1b69e1 commit 41ba27bCopy full SHA for 41ba27b
src/mikro-orm.module.ts
@@ -17,6 +17,14 @@ import { MikroOrmEntitiesStorage } from './mikro-orm.entities.storage';
17
@Module({})
18
export class MikroOrmModule {
19
20
+ /**
21
+ * Clears the entity storage. This is useful for testing purposes, when you want to isolate the tests.
22
+ * Keep in mind that this should be called when using a test runner that keeps the context alive between tests (like Vitest with threads disabled).
23
+ */
24
+ static clearStorage(contextName?: string) {
25
+ MikroOrmEntitiesStorage.clear(contextName);
26
+ }
27
+
28
static forRoot(options?: MikroOrmModuleSyncOptions): DynamicModule {
29
return {
30
module: MikroOrmModule,
0 commit comments