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

Function mockInstance

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

Source from the content-addressed store, hash-verified

22import { FetchModule } from '../indexer/fetch.module';
23
24const mockInstance = async (
25 cid: string,
26 schemaName: string,
27 historical: HistoricalMode,
28 useSubscription: boolean,
29 timestampField: boolean,
30) => {
31 const argv: Record<string, any> = {
32 _: [],
33 historical,
34 subquery: `ipfs://${cid}`,
35 dbSchema: schemaName,
36 allowSchemaMigration: true,
37 ipfs: 'https://unauthipfs.subquery.network/ipfs/api/v0',
38 networkEndpoint: 'https://rpc.polkadot.io/public',
39 timestampField,
40 subscription: useSubscription,
41 // unfinalizedBlocks: false,
42 };
43 return registerApp<SubqueryProject>(
44 argv,
45 createSubQueryProject,
46 () => {}, //jest.fn(),
47 '',
48 );
49};
50
51async function mockRegister(
52 cid: string,

Callers 1

mockRegisterFunction · 0.85

Calls 1

registerAppFunction · 0.90

Tested by

no test coverage detected