ACTIVEPIECES/packages/engine/test/helper/logging-utils.test.ts
rohit cd823a2d9e
Some checks failed
Crowdin Action / synchronize-with-crowdin (push) Has been cancelled
Release Pieces / Release-Pieces (push) Has been cancelled
automaton layer
2025-07-05 23:59:03 +05:30

27 lines
787 B
TypeScript

import {
ActionType,
GenericStepOutput,
StepOutputStatus,
} from '@activepieces/shared'
import { loggingUtils } from '../../src/lib/helper/logging-utils'
describe('Logging Utils', () => {
it('Should not truncate whole step if its log size exceeds limit', async () => {
const steps = {
mockStep: GenericStepOutput.create({
type: ActionType.CODE,
status: StepOutputStatus.SUCCEEDED,
input: {
a: 'a'.repeat(1024 * 1024 * 12),
},
}),
}
// act
const result = await loggingUtils.trimExecution(steps)
// assert
expect((result.mockStep.input as Record<string, string>).a.length).toBeLessThan(1024 * 1024 * 12)
})
})