Compare commits

...

1 Commits

Author SHA1 Message Date
Peter Steinberger
b1b45ce272 fix(ci): keep raw output untruncated 2025-12-06 01:45:49 +01:00

View File

@ -1,21 +1,20 @@
import { describe, expect, it, vi } from 'vitest'; import { describe, expect, it, vi } from 'vitest';
import { printCallOutput } from '../src/cli/output-utils.js'; import { printCallOutput } from '../src/cli/output-utils.js';
import { createCallResult } from '../src/result-utils.js';
describe('printCallOutput raw output', () => { describe('printCallOutput raw output', () => {
it('does not truncate long strings when printing raw output', () => { it('does not truncate long strings when printing raw output', () => {
const longText = 'x'.repeat(15000); const longText = 'x'.repeat(15000);
const log = vi.spyOn(console, 'log').mockImplementation(() => {}); const log = vi.spyOn(console, 'log').mockImplementation(() => {});
const wrapped = { const raw = { t: longText };
json: () => null, const wrapped = createCallResult(raw);
markdown: () => null,
text: () => null,
};
try { try {
printCallOutput(wrapped as any, { t: longText }, 'raw'); printCallOutput(wrapped, raw, 'raw');
expect(log).toHaveBeenCalledTimes(1); expect(log).toHaveBeenCalledTimes(1);
const logged = log.mock.calls[0][0] as string; const logged = log.mock.calls[0]?.[0];
expect(typeof logged).toBe('string');
expect(logged).not.toContain('... 5000 more characters'); expect(logged).not.toContain('... 5000 more characters');
expect(logged).toContain(longText.slice(-50)); expect(logged).toContain(longText.slice(-50));
} finally { } finally {