MCPcopy Create free account
hub / github.com/subquery/subql / prepareApp

Function prepareApp

packages/node/src/utils/test.utils.ts:90–118  ·  view source on GitHub ↗
(
  schemaName: string,
  cid: string,
  disableHistorical = false,
  useSubscription = false,
  timestampField = false,
)

Source from the content-addressed store, hash-verified

88}
89
90export async function prepareApp(
91 schemaName: string,
92 cid: string,
93 disableHistorical = false,
94 useSubscription = false,
95 timestampField = false,
96): Promise<INestApplication> {
97 const m = await Test.createTestingModule({
98 imports: [
99 DbModule.forRoot(),
100 EventEmitterModule.forRoot(),
101 mockRegister(
102 cid,
103 schemaName,
104 disableHistorical ? false : 'height',
105 useSubscription,
106 timestampField,
107 ),
108 ScheduleModule.forRoot(),
109 CoreModule,
110 FetchModule,
111 ],
112 controllers: [],
113 }).compile();
114
115 const app = m.createNestApplication();
116 await app.init();
117 return app;
118}

Calls 3

mockRegisterFunction · 0.85
initMethod · 0.65
forRootMethod · 0.45

Tested by

no test coverage detected