Skip to content

Commit e02b42b

Browse files
committed
test(everything): fix get-env tests to match actual output format
The get-env tool returns 'KEY=value' format, not JSON. Updated assertions accordingly.
1 parent 752e4f9 commit e02b42b

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

src/everything/__tests__/tools.test.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,20 +162,22 @@ describe('Tools', () => {
162162
expect(result.content).toHaveLength(1);
163163
expect(result.content[0].type).toBe('text');
164164

165-
const envJson = JSON.parse(result.content[0].text);
166-
expect(envJson.TEST_VAR_EVERYTHING).toBe('test_value');
165+
const text = result.content[0].text;
166+
expect(text).toBe('TEST_VAR_EVERYTHING=test_value');
167167

168168
delete process.env.TEST_VAR_EVERYTHING;
169169
});
170170

171-
it('should return valid JSON', async () => {
171+
it('should return valid output', async () => {
172172
const { mockServer, handlers } = createMockServer();
173173
registerGetEnvTool(mockServer);
174174

175175
const handler = handlers.get('get-env')!;
176176
const result = await handler({ key: 'PATH' });
177177

178-
expect(() => JSON.parse(result.content[0].text)).not.toThrow();
178+
expect(result.content).toHaveLength(1);
179+
expect(result.content[0].type).toBe('text');
180+
expect(result.content[0].text).toMatch(/^PATH=/);
179181
});
180182
});
181183

0 commit comments

Comments
 (0)