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

Function mockRegister

packages/node/src/utils/test.utils.ts:51–88  ·  view source on GitHub ↗
(
  cid: string,
  schemaName: string,
  historical: HistoricalMode,
  useSubscription: boolean,
  timestampField: boolean,
)

Source from the content-addressed store, hash-verified

49};
50
51async function mockRegister(
52 cid: string,
53 schemaName: string,
54 historical: HistoricalMode,
55 useSubscription: boolean,
56 timestampField: boolean,
57): Promise<DynamicModule> {
58 const { nodeConfig, project } = await mockInstance(
59 cid,
60 schemaName,
61 historical,
62 useSubscription,
63 timestampField,
64 );
65
66 return {
67 module: ConfigureModule,
68 providers: [
69 {
70 provide: NodeConfig,
71 useValue: nodeConfig,
72 },
73 {
74 provide: 'ISubqueryProject',
75 useValue: project,
76 },
77 {
78 provide: 'IProjectUpgradeService',
79 useValue: project,
80 },
81 {
82 provide: 'Null',
83 useValue: null,
84 },
85 ],
86 exports: [NodeConfig, 'ISubqueryProject', 'IProjectUpgradeService', 'Null'],
87 };
88}
89
90export async function prepareApp(
91 schemaName: string,

Callers 1

prepareAppFunction · 0.85

Calls 1

mockInstanceFunction · 0.85

Tested by

no test coverage detected