From 5bd751bd91ba9ca0fcedbfbb8b6881bb85e0b439 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Kwas=CC=81niewski?= Date: Wed, 25 Sep 2024 05:51:49 -0700 Subject: [PATCH] fix: running local tests (#46615) Summary: This PR fixes running local tests. ### Before Tests from Pods/ are executed (including Hermes tests) ![CleanShot 2024-09-24 at 10 09 04@2x](https://github.com/user-attachments/assets/5d766321-1099-4970-bc4d-cf20ec1f5d89) ### After ![CleanShot 2024-09-24 at 10 10 24@2x](https://github.com/user-attachments/assets/356b0db3-9278-4cb3-a216-2ca78b623950) ## Changelog: [INTERNAL] [FIXED] - Make tests run locally Pull Request resolved: https://github.com/facebook/react-native/pull/46615 Test Plan: 1. Run yarn run test (with and without the change). Make sure you have installed pods. Reviewed By: huntie Differential Revision: D63383063 Pulled By: cipolleschi fbshipit-source-id: d7352f80c0fe4efdbb169e1adc4d5f60179f78e8 --- jest.config.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/jest.config.js b/jest.config.js index d4ac1188db3..5a36fd90a5e 100644 --- a/jest.config.js +++ b/jest.config.js @@ -11,6 +11,11 @@ const {defaults} = require('jest-config'); +const PODS_LOCATIONS = [ + 'packages/rn-tester/Pods', + 'packages/helloworld/ios/Pods', +]; + module.exports = { transform: { '^.+\\.(bmp|gif|jpg|jpeg|mp4|png|psd|svg|webp)$': @@ -33,6 +38,8 @@ module.exports = { '/packages/react-native/sdks', '/packages/react-native/Libraries/Renderer', '/packages/react-native-test-renderer/src', + '/packages/react-native/sdks/hermes/', + ...PODS_LOCATIONS, ], transformIgnorePatterns: ['node_modules/(?!@react-native/)'], haste: { @@ -40,7 +47,11 @@ module.exports = { platforms: ['ios', 'android'], }, moduleFileExtensions: ['fb.js'].concat(defaults.moduleFileExtensions), - modulePathIgnorePatterns: ['scripts/.*/__fixtures__/'], + modulePathIgnorePatterns: [ + 'scripts/.*/__fixtures__/', + '/packages/react-native/sdks/hermes/', + ...PODS_LOCATIONS, + ], unmockedModulePathPatterns: [ 'node_modules/react/', 'packages/react-native/Libraries/Renderer',