Skip to content

Commit

Permalink
Fix same error in more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
stwiname committed Sep 8, 2022
1 parent 4d34fad commit a6e61b2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
1 change: 0 additions & 1 deletion packages/node/src/indexer/dictionary.service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,5 @@ describe('DictionaryService', () => {
const dictionaryService = new DictionaryService(project, nodeConfig);

const specVersions = await dictionaryService.getSpecVersions();
console.log(specVersions);
}, 500000);
});
18 changes: 14 additions & 4 deletions packages/node/src/indexer/fetch.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { DsProcessorService } from './ds-processor.service';
import { DynamicDsService } from './dynamic-ds.service';
import { FetchService } from './fetch.service';
import { IndexerManager } from './indexer.manager';
import { ProjectService } from './project.service';
import { BlockContent } from './types';
import { BlockDispatcherService } from './worker/block-dispatcher.service';

Expand Down Expand Up @@ -261,6 +262,15 @@ function testSubqueryProjectV0_2_0(): SubqueryProject {
};
}

function mockProjectService(): ProjectService {
return {
blockOffset: 1,
getProcessedBlockCount: jest.fn(() => Promise.resolve(0)),
upsertMetadataBlockOffset: jest.fn(),
setBlockOffset: jest.fn(),
} as any;
}

function createFetchService(
apiService = mockApiService(),
indexerManager: IndexerManager,
Expand All @@ -287,7 +297,7 @@ function createFetchService(
nodeConfig,
indexerManager,
eventEmitter,
null,
mockProjectService(),
),
dictionaryService,
dsProcessorService,
Expand Down Expand Up @@ -450,7 +460,7 @@ describe('FetchService', () => {
nodeConfig,
mockIndexerManager(),
eventEmitter,
null,
mockProjectService(),
);
fetchService = new FetchService(
apiService,
Expand Down Expand Up @@ -534,7 +544,7 @@ describe('FetchService', () => {
nodeConfig,
mockIndexerManager(),
eventEmitter,
null,
mockProjectService(),
);
fetchService = new FetchService(
apiService,
Expand Down Expand Up @@ -611,7 +621,7 @@ describe('FetchService', () => {
nodeConfig,
mockIndexerManager(),
eventEmitter,
null,
mockProjectService(),
);
fetchService = new FetchService(
apiService,
Expand Down

0 comments on commit a6e61b2

Please sign in to comment.