Skip to content

Commit

Permalink
test: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tokebe committed Mar 22, 2024
1 parent 996370a commit 6835603
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 23 deletions.
19 changes: 0 additions & 19 deletions __test__/integration/BatchEdgeQueryHandler.test.ts

This file was deleted.

9 changes: 5 additions & 4 deletions __test__/integration/TRAPIQueryHandler.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import axios from 'axios';
import axios, { AxiosStatic } from 'axios';
jest.mock('axios');
const mockedAxios = axios as jest.Mocked<AxiosStatic>;

import TRAPIQueryHandler from '../../src/index';
import path from 'path';
Expand All @@ -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: {
Expand Down Expand Up @@ -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' },
Expand Down Expand Up @@ -139,6 +140,6 @@ describe('Testing TRAPIQueryHandler Module', () => {
queryHandler.setQueryGraph(OneHopQuery);
await queryHandler.query();
expect(queryHandler.knowledgeGraph.kg).toHaveProperty('nodes');
}, 15000);
}, 30000);
});
});

0 comments on commit 6835603

Please sign in to comment.