fix(jest): ignore storybook-static and package __mocks__ directories#37946
Open
fix(jest): ignore storybook-static and package __mocks__ directories#37946
Conversation
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 <noreply@anthropic.com>
Contributor
Code Review Agent Run #442926Actionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes local Jest test runs that were failing with confusing errors due to duplicate files being scanned.
Issues Fixed
Haste module naming collision
The
storybook-static/build artifact contains a copy ofpackage.jsonwith"name": "superset", causing Jest's Haste module resolver to fail.Duplicate manual mock warnings
The
packages/superset-ui-core/__mocks__/directory contains copies of the canonical mocks inspec/__mocks__/, causing ambiguity.Solution
Add these directories to
modulePathIgnorePatternsinjest.config.js:<rootDir>/storybook-static- build artifact directory<rootDir>/packages/.*/__mocks__- package-level mocks (canonical mocks are inspec/__mocks__/)Test Plan
npx jest --testPathPatterns="deckgl"- all 273 tests pass🤖 Generated with Claude Code