Skip to content

Commit

Permalink
test: fix STT tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ijemmao committed Dec 3, 2024
1 parent 3c29232 commit 786224d
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/controllers/__tests__/speechToText.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import axios from 'axios';
import {
nextFunctionFixture,
requestFixture,
responseFixture,
nextFunctionFixture,
} from '../../__tests__/shared/fixtures';
import { IGBO_STT_API } from '../../config';
import { getTranscription } from '../speechToText';
import { fetchBase64Data } from '../utils/fetchBase64Data';

Expand Down Expand Up @@ -38,12 +39,12 @@ describe('speechToText', () => {
// @ts-expect-error non-existing value
expect(axios.request.mock.calls[1][0]).toMatchObject({
method: 'POST',
url: 'http://localhost:3333/predict',
url: IGBO_STT_API,
headers: {
'Content-Type': 'application/json',
'X-API-Key': 'main_key',
},
data: { id: 'audioId', url: 'https://igboapi.com' },
data: { audioUrl: 'https://igboapi.com' },
});
});

Expand Down Expand Up @@ -71,12 +72,12 @@ describe('speechToText', () => {
// @ts-expect-error non-existing value
expect(axios.request.mock.calls[1][0]).toMatchObject({
method: 'POST',
url: 'http://localhost:3333/predict',
url: IGBO_STT_API,
headers: {
'Content-Type': 'application/json',
'X-API-Key': 'main_key',
},
data: { id: 'audioId', url: 'https://igboapi.com' },
data: { audioUrl: 'https://igboapi.com' },
});
});

Expand Down Expand Up @@ -104,12 +105,12 @@ describe('speechToText', () => {
});
expect(axios.request).toHaveBeenCalledWith({
method: 'POST',
url: 'http://localhost:3333/predict',
url: IGBO_STT_API,
headers: {
'Content-Type': 'application/json',
'X-API-Key': 'main_key',
},
data: { id: 'audioId', url: audioUrl },
data: { audioUrl },
});
});

Expand Down

0 comments on commit 786224d

Please sign in to comment.