From 9536b8bce901c3eeb50ae7c7f657dff5e98f0931 Mon Sep 17 00:00:00 2001 From: Rudy Fraser Date: Tue, 10 Nov 2026 16:50:52 -0500 Subject: [PATCH] test(merge): keep worklet bundle mode out of Jest runs Bundle mode writes generated worklet files during transform, which races across Jest's parallel workers on a cold cache. --- babel.config.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/babel.config.js b/babel.config.js index c6776bdb6..9540cec24 100644 --- a/babel.config.js +++ b/babel.config.js @@ -66,16 +66,21 @@ const stripSentryDebug = ({types}) => ({ }, }) -const workletsPluginOptions = { - bundleMode: true, - strictGlobal: true, // optional, but recommended -} - /** * @param {import("@babel/core").ConfigAPI} api * @returns {import("@babel/core").InputOptions} */ module.exports = function (api) { + const workletsPluginOptions = { + /* + * Bundle mode writes each worklet to a file as it transforms. Jest + * transforms in parallel workers, so a worker can load a file another is + * still writing. + */ + bundleMode: !api.env('test'), + strictGlobal: true, // optional, but recommended + } + return { presets: [ [ -- knotmirror 0.0.1