This is an automated email from the ASF dual-hosted git repository.

rusackas pushed a commit to branch fix/jest-nested-node-modules-esm
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 9928251e64938454f7f38b03884b819f8e93013e
Author: Evan Rusackas <[email protected]>
AuthorDate: Thu Feb 12 16:56:19 2026 -0800

    fix(jest): ignore storybook-static and package __mocks__ directories
    
    Jest was encountering issues when running tests locally:
    
    1. **Haste module naming collision**: storybook-static/package.json
       contains `"name": "superset"` which conflicts with the main
       package.json, causing "Haste module naming collision: superset"
    
    2. **Duplicate manual mock warnings**: packages/superset-ui-core/__mocks__/
       contains the same mock files as spec/__mocks__/, causing
       "duplicate manual mock found" warnings for mockExportObject,
       mockExportString, and svgrMock
    
    These issues were causing local test runs to fail or behave
    inconsistently. Adding these directories to modulePathIgnorePatterns
    resolves both issues.
    
    Co-Authored-By: Claude Opus 4.5 <[email protected]>
---
 superset-frontend/jest.config.js | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/superset-frontend/jest.config.js b/superset-frontend/jest.config.js
index bd9b636f89b..8b3f92d70fd 100644
--- a/superset-frontend/jest.config.js
+++ b/superset-frontend/jest.config.js
@@ -42,6 +42,9 @@ module.exports = {
     '<rootDir>/packages/.*/lib',
     '<rootDir>/plugins/.*/esm',
     '<rootDir>/plugins/.*/lib',
+    // Ignore build artifacts that contain duplicate package.json or mock files
+    '<rootDir>/storybook-static',
+    '<rootDir>/packages/.*/__mocks__',
   ],
   setupFilesAfterEnv: ['<rootDir>/spec/helpers/setup.ts'],
   snapshotSerializers: ['@emotion/jest/serializer'],

Reply via email to