n8n/packages/workflow/test/setup-vm-evaluator.ts
Declan Carroll ecfc39b3e5
ci: Stand up multi-package mutation health — nightly passes + mutant-* skills (no-changelog) (#31356)
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-01 08:57:25 +00:00

21 lines
516 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.initExpressionEngine({
engine: 'vm',
poolSize: 1,
maxCodeCacheSize: 1024,
bridgeTimeout: 5000,
bridgeMemoryLimit: 128,
});
});
afterAll(async () => {
await Expression.disposeExpressionEngine();
});
}