Amazon Developer

as

Settings
Sign out
Notifications
Alexa
Amazon Appstore
Ring
AWS
Documentation
Support
Contact Us
My Cases
Get Started
Design and Develop
Publish
Reference
Support
Skip to main content

6.1 Update jest.config.js

The transformIgnorePatterns must include @amazon-devices/react-native-kepler. The package 4.0.0 uses ES module syntax in its jest/setup.js file. Without this pattern, Jest fails with SyntaxError: Cannot use import statement outside a module.

6.2 Create jest.setup.js for TV mocks

RN 0.83 changes how mocks work in the test environment. Create a setup file with TV-appropriate mocks, such as the example below.

6.3 Fix Jest mocks for .default exports

RN 0.83 changes many internal modules to use export default. Existing Jest mocks that return plain objects without a .default property break silently, where components receive undefined at runtime. Symptom Cannot read properties of undefined (reading 'create') across multiple test suites. Affected modules
  • react-native/Libraries/StyleSheet/StyleSheet
  • react-native/Libraries/StyleSheet/flattenStyle
  • react-native/Libraries/EventEmitter/NativeEventEmitter
  • react-native/Libraries/Utilities/Platform
  • react-native/Libraries/Utilities/Dimensions
  • react-native/Libraries/Utilities/PixelRatio
  • react-native/Libraries/Utilities/useWindowDimensions
  • react-native/Libraries/BatchedBridge/NativeModules
Fix pattern for object-type exports
Fix pattern for function-type exports:

6.4 Update test files with act() wrapping

React 19 requires state updates in tests to be wrapped in act(), such as the example below.
@testing-library/react-native If you use @testing-library/react-native, the testing library handles act() internally. Don’t wrap render() in ReactTestRenderer.act() because this causes “Can’t access .root on unmounted test renderer” errors.

6.5 Fix navigation stack timer leaks

If you use react-navigation__stack, its Card.tsx file uses animation setTimeout callbacks that fire after Jest tears down the test environment. Symptom You are trying to import a file after the Jest environment has been torn down Fix: add to affected test files

6.6 Fix isolatedModules type export errors

If TypeScript reports TS1205: Re-exporting a type when 'isolatedModules' is enabled requires using 'export type', update your export type like the example below.

6.7 Update snapshots

After all test fixes, regenerate snapshots.
Review changes. Expected React 19 snapshot differences include:
  • Component wrapper structure changes
  • Attribute ordering differences
  • Text node rendering modifications
  • Async boundary updates
Use git diff to review snapshot changes before committing.
Last modified on July 9, 2026