diff --git a/__test__/integration/BatchEdgeQueryHandler.test.ts b/__test__/integration/BatchEdgeQueryHandler.test.ts deleted file mode 100644 index 16795516..00000000 --- a/__test__/integration/BatchEdgeQueryHandler.test.ts +++ /dev/null @@ -1,19 +0,0 @@ -import BatchEdgeQueryHandler from '../../src/batch_edge_query'; -import MetaKG from '@biothings-explorer/smartapi-kg'; - -describe('Testing BatchEdgeQueryHandler Module', () => { - const kg = new MetaKG(); - kg.constructMetaKGSync(); - - describe('Testing query function', () => { - test('test subscribe and unsubscribe function', () => { - const batchHandler = new BatchEdgeQueryHandler(kg); - batchHandler.subscribe(1); - batchHandler.subscribe(2); - batchHandler.subscribe(3); - expect(batchHandler.subscribers).toContain(2); - batchHandler.unsubscribe(2); - expect(batchHandler.subscribers).not.toContain(2); - }); - }); -}); diff --git a/__test__/integration/TRAPIQueryHandler.test.ts b/__test__/integration/TRAPIQueryHandler.test.ts index b815ee4f..425fd3cc 100644 --- a/__test__/integration/TRAPIQueryHandler.test.ts +++ b/__test__/integration/TRAPIQueryHandler.test.ts @@ -1,5 +1,6 @@ -import axios from 'axios'; +import axios, { AxiosStatic } from 'axios'; jest.mock('axios'); +const mockedAxios = axios as jest.Mocked; import TRAPIQueryHandler from '../../src/index'; import path from 'path'; @@ -26,7 +27,7 @@ describe('Testing TRAPIQueryHandler Module', () => { }; describe('Testing query function', () => { test('test with one query edge', async () => { - (axios.get as jest.Mock).mockResolvedValue({ + (mockedAxios.get as jest.Mock).mockResolvedValue({ data: { message: { query_graph: { @@ -101,7 +102,7 @@ describe('Testing TRAPIQueryHandler Module', () => { workflow: [{ id: 'lookup' }], }, }); - (axios.post as jest.Mock).mockResolvedValue({ + (mockedAxios.post as jest.Mock).mockResolvedValue({ data: { 'MONDO:0005737': { id: { identifier: 'MONDO:0005737', label: 'Ebola hemorrhagic fever' }, @@ -139,6 +140,6 @@ describe('Testing TRAPIQueryHandler Module', () => { queryHandler.setQueryGraph(OneHopQuery); await queryHandler.query(); expect(queryHandler.knowledgeGraph.kg).toHaveProperty('nodes'); - }, 15000); + }, 30000); }); });