Skip to content

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

Merged
BartoszKlonowski merged 2 commits into
callstack:mainfrom
huytdps13400:fix/jest-environment-version
Oct 15, 2026
Merged

BartoszKlonowski merged 2 commits into
callstack:mainfrom
huytdps13400:fix/jest-environment-version

Conversation

@huytdps13400

Copy link
Copy Markdown
Contributor

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.

@huytdps13400
huytdps13400 force-pushed the fix/jest-environment-version branch from 6030510 to d65c28f Compare October 5, 2026 06:54
@BartoszKlonowski
BartoszKlonowski self-requested a review October 6, 2026 09:37
@BartoszKlonowski BartoszKlonowski added the v6 Issues that are either resolved by, or checked against the v6 release label Oct 12, 2026

@BartoszKlonowski BartoszKlonowski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me revert the jest-environment-node, but beside that, this looks good :)
I'll merge as soon as checks pass, thank you!

Comment thread package/package.json Outdated
Comment thread package/package-lock.json Outdated
Co-authored-by: Bartosz Klonowski <70535775+BartoszKlonowski@users.noreply.github.com>
@BartoszKlonowski
BartoszKlonowski merged commit 78d71a3 into callstack:main Oct 15, 2026
6 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v6 Issues that are either resolved by, or checked against the v6 release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants