n8n/packages/workflow/test/setup-vm-evaluator.ts
Danny Martini 2614154b71
feat(core): Wire expression-runtime behind N8N_EXPRESSION_ENGINE=vm flag (no-changelog) (#26528)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 13:55:04 +00:00

15 lines
396 B
TypeScript

import { Expression } from '../src/expression';
// Only runs when N8N_EXPRESSION_ENGINE=vm is set.
// Initializes the VM evaluator once per vitest worker before all tests,
// and disposes it after.
if (process.env.N8N_EXPRESSION_ENGINE === 'vm') {
beforeAll(async () => {
await Expression.initializeVmEvaluator();
});
afterAll(async () => {
await Expression.disposeVmEvaluator();
});
}