VM error tests now exercise real bridge boundary
Expression error handling tests now verify that errors survive the trip across the isolate boundary intact — with real end-to-end coverage instead of mocks that bypassed the actual code path.
Expression error tests were passing without actually testing error reconstruction. The old approach mocked the VM evaluator with setVmEvaluator(), so errors never crossed the isolate boundary — they returned pre-formed, skipping mapVmError() entirely.
The new tests throw from a getter on connectionInputData, forcing errors to traverse the bridge boundary, serialize, and reconstruct through mapVmError(). Using toEqual() assertions catches any field dropped during reconstruction of ExpressionError or ExpressionExtensionError objects.
This matters for production reliability. Error messages that reach users will have crossed this boundary — these tests now verify that what users see matches what was thrown. Previously, test coverage was illusion: passing tests with zero coverage of the real error path.
In the n8n workflow execution engine, expression errors must serialize correctly across the VM boundary. This work is part of the broader effort to improve error handling robustness (CAT-2543).
View Original GitHub DescriptionFact Check
Summary
- Replaces mock-based ExpressionError and ExpressionExtensionError description preservation tests with real end-to-end integration tests
- The old tests used
setVmEvaluator()to mock the evaluator, so errors never crossed the isolate boundary — they passed trivially viaisExpressionError()without exercisingmapVmError's reconstruction - New tests throw from a getter on
connectionInputData, so the error crosses the bridge boundary, gets serialized/reconstructed, and goes throughmapVmError - Uses
toEqualto assert the entire error object matches, catching any field dropped during reconstruction
Linear ticket: https://linear.app/n8n/issue/CAT-2543
🤖 Generated with Claude Code