Skip to content

CLI crashes when test data content exceeds terminal width #358

@da1z

Description

@da1z

Description

When running evalite with test data that contains long strings (e.g., email subjects/body content), the CLI crashes during result rendering with a table package error.

Error

Error: Subject parameter value width cannot be greater than the container width.
    at alignString (table/dist/src/alignString.js:42:15)
    at table/dist/src/alignTableData.js:15:50
    at Array.map (<anonymous>)
    at table/dist/src/alignTableData.js:7:20
    at Array.map (<anonymous>)
    at alignTableData (table/dist/src/alignTableData.js:6:17)
    at table (table/dist/src/table.js:26:48)
    at renderTable (evalite/dist/reporter/rendering.js:116:16)
    at renderDetailedTable (evalite/dist/reporter/rendering.js:180:5)
    at EvaliteReporter.customTestSummary (evalite/dist/reporter.js:164:17)

Steps to Reproduce

  1. Create an eval with long input strings, e.g.:
{
  input: createMockEmail(
    "promo@onlinestore.com",
    "🔥 FLASH SALE: 50% OFF Everything Today Only!",
    "Don't miss out on our biggest sale of the year! Use code SAVE50 at checkout. Shop now before it's too late! This email was sent to you because you made a purchase. To unsubscribe, click here."
  ),
  expected: "SPAM_LOW_PRIORITY",
}
  1. Run evalite
  2. Tests pass (100% score) but CLI crashes when rendering the summary table

Expected Behavior

The CLI should handle long content gracefully - either by truncating, wrapping, or using a different display format when terminal width is insufficient.

Actual Behavior

The evals complete successfully, but the process exits with code 1 due to the rendering error.

Environment

  • evalite: 0.19.0
  • table: 6.9.0
  • OS: macOS

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions