Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
timvanoostrom committed Jan 9, 2025
1 parent d80234b commit 6eff5c3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/server/helpers/source-api-request.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ describe('requestData.ts', () => {
);

expect(axiosRequestSpy).toHaveBeenCalledTimes(0);
expect(rs).toStrictEqual(apiPostponeResult());
expect(rs).toStrictEqual(apiPostponeResult(null));
});

it('A requests responds with error', async () => {
Expand Down
5 changes: 3 additions & 2 deletions src/server/services/controller.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
RequestMock,
ResponseMock,
} from '../../testing/utils';
import { apiSuccessResult } from '../../universal/helpers/api';

const mocks = vi.hoisted(() => {
return {
Expand Down Expand Up @@ -188,7 +189,7 @@ describe('controller', () => {

test('addServiceResultHandler', async () => {
const resMock = ResponseMock.new();
const data = { foo: 'bar' };
const data = { X: apiSuccessResult({ foo: 'bar' }) };
const servicePromise = Promise.resolve(data);

const result = await addServiceResultHandler(
Expand All @@ -198,7 +199,7 @@ describe('controller', () => {
);

expect(resMock.write).toHaveBeenCalledWith(
`event: message\nid: test-service\ndata: {"foo":"bar"}\n\n`
`event: message\nid: test-service\ndata: {"X":{"content":{"foo":"bar"},"status":"OK"}}\n\n`
);

expect(result).toEqual(data);
Expand Down

0 comments on commit 6eff5c3

Please sign in to comment.