From 4e0414d899e3e09a8bb2be29d16b607e7e1d78d0 Mon Sep 17 00:00:00 2001 From: Manzoor Wani Date: Fri, 11 Sep 2026 13:17:03 +0530 Subject: [PATCH] Unit Tests: Resolve @ariakit/utils through its dependents The Jest config resolved @ariakit/utils from packages/components, which only works when dependencies are hoisted. It is a transitive dependency two hops away, so resolve it through @ariakit/react and @ariakit/react-components instead. --- test/unit/jest.config.js | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/test/unit/jest.config.js b/test/unit/jest.config.js index e4f142c339b041..f8fae2c0ac372d 100644 --- a/test/unit/jest.config.js +++ b/test/unit/jest.config.js @@ -38,13 +38,21 @@ const dependenciesToTransform = [ process.env.TZ = 'UTC'; /* - * Resolved rather than hardcoded to `/node_modules`, - * which is empty under non-hoisting installs. + * Resolved hop by hop through its dependents rather than hardcoded to + * `/node_modules`, which is empty under non-hoisting installs. */ -const ariakitUtilsDir = path.dirname( - require.resolve( '@ariakit/utils/package.json', { - paths: [ path.join( ROOT_DIR, 'packages/components' ) ], - } ) +const ariakitUtilsDir = [ + '@ariakit/react', + '@ariakit/react-components', + '@ariakit/utils', +].reduce( + ( fromDir, packageName ) => + path.dirname( + require.resolve( `${ packageName }/package.json`, { + paths: [ fromDir ], + } ) + ), + path.join( ROOT_DIR, 'packages/components' ) ); const commonProjectConfig = {