Skip to content

test: align the Slider Jest environment with Jest 30 - #831

Open
huytdps13400 wants to merge 1 commit into
callstack:mainfrom
huytdps13400:fix/jest-environment-version
Open

huytdps13400 wants to merge 1 commit into
callstack:mainfrom
huytdps13400:fix/jest-environment-version

Conversation

@huytdps13400

Copy link
Copy Markdown

Summary:

npm test fails before executing any tests on current main with this._moduleMocker.clearMocksOnScope is not a function. The package runs Jest 30, but the React Native 0.81 preset resolves its nested Jest 29 Node environment.

Declare Jest 30's Node environment as a development dependency and select it explicitly. Keep the React Native preset for its transforms, resolver and setup files, and configure its require / react-native export conditions on the selected environment. The lockfile only records the direct dependency; resolved package versions do not change.

Test Plan:

  • Before: the ordinary package test command fails all four suites before running any tests.
  • After a fresh npm ci --ignore-scripts, npm test -- --runInBand passes all four suites and 16 tests with no custom environment argument or external adapter.
  • jest --showConfig resolves the package's Node environment, includes both React Native export conditions, and retains React Native's setup file and resolver.
  • TypeScript, Babel build, ESLint (0 errors, 6 existing warnings), Prettier and diff checks pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant