Skip to content

Commit 840b9dc

Browse files
committed
test(memory): add null-data path test for memory_get transformResponse
1 parent 63327c3 commit 840b9dc

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

apps/sim/tools/memory/get.test.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,20 @@ describe('memoryGetTool', () => {
3636
expect(url).toBe('/api/memory/team%2Fuser%20123?workspaceId=workspace-1')
3737
})
3838

39+
it('returns empty memories when key is not found (null data)', async () => {
40+
const result = await transformResponse(
41+
new Response(JSON.stringify({ success: true, data: null }))
42+
)
43+
44+
expect(result).toEqual({
45+
success: true,
46+
output: {
47+
memories: [],
48+
message: 'No memories found',
49+
},
50+
})
51+
})
52+
3953
it('wraps the exact memory response as a single result', async () => {
4054
const result = await transformResponse(
4155
new Response(

0 commit comments

Comments
 (0)