diff --git a/src/server/helpers/source-api-request.test.ts b/src/server/helpers/source-api-request.test.ts index fb60edc8b..1c252a867 100644 --- a/src/server/helpers/source-api-request.test.ts +++ b/src/server/helpers/source-api-request.test.ts @@ -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 () => { diff --git a/src/server/services/controller.test.ts b/src/server/services/controller.test.ts index 6a8661f14..0c19eb36e 100644 --- a/src/server/services/controller.test.ts +++ b/src/server/services/controller.test.ts @@ -22,6 +22,7 @@ import { RequestMock, ResponseMock, } from '../../testing/utils'; +import { apiSuccessResult } from '../../universal/helpers/api'; const mocks = vi.hoisted(() => { return { @@ -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( @@ -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);