From 0ae090361a0290f192ac456de47f971dd43a3c78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Jastrze=CC=A8bski?= Date: Thu, 11 Jun 2026 21:30:51 +0200 Subject: [PATCH 1/3] v0 --- test-apps/native/jestSetup.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/test-apps/native/jestSetup.js b/test-apps/native/jestSetup.js index 614b8ad7..bd7d3e8e 100644 --- a/test-apps/native/jestSetup.js +++ b/test-apps/native/jestSetup.js @@ -4,3 +4,20 @@ configure({ testingLibrary: 'react-native', verbose: true, }); + +beforeAll(() => { + const React = require('react'); + // __CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE IS the + // ReactSharedInternals object — the same reference React reads internally. + const internals = + React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; + if (internals != null && 'recentlyCreatedOwnerStacks' in internals) { + Object.defineProperty(internals, 'recentlyCreatedOwnerStacks', { + get: () => Infinity, + set: () => {}, + configurable: true, + }); + } + + delete console.createTask; +}); \ No newline at end of file From 3185727a1a84f17ecb27d701c041f0cb0f6a795f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Jastrze=CC=A8bski?= Date: Thu, 11 Jun 2026 21:39:24 +0200 Subject: [PATCH 2/3] just part 1 --- test-apps/native/jestSetup.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test-apps/native/jestSetup.js b/test-apps/native/jestSetup.js index bd7d3e8e..abd753ac 100644 --- a/test-apps/native/jestSetup.js +++ b/test-apps/native/jestSetup.js @@ -6,6 +6,7 @@ configure({ }); beforeAll(() => { + // part 1 const React = require('react'); // __CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE IS the // ReactSharedInternals object — the same reference React reads internally. @@ -19,5 +20,6 @@ beforeAll(() => { }); } - delete console.createTask; + // part 2 + // delete console.createTask; }); \ No newline at end of file From e78cb88359c5c2c3c251055caacfb4bfaa02f091 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Jastrze=CC=A8bski?= Date: Fri, 12 Jun 2026 11:47:27 +0200 Subject: [PATCH 3/3] use react-test-config --- .yarnrc.yml | 2 ++ test-apps/native/jestSetup.js | 21 ++++----------------- test-apps/native/package.json | 1 + yarn.lock | 10 ++++++++++ 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/.yarnrc.yml b/.yarnrc.yml index ffb1f261..d69d1ffa 100644 --- a/.yarnrc.yml +++ b/.yarnrc.yml @@ -1,2 +1,4 @@ nodeLinker: node-modules npmMinimalAgeGate: '3d' +npmPreapprovedPackages: + - react-test-config diff --git a/test-apps/native/jestSetup.js b/test-apps/native/jestSetup.js index abd753ac..0ee38474 100644 --- a/test-apps/native/jestSetup.js +++ b/test-apps/native/jestSetup.js @@ -1,25 +1,12 @@ import { configure } from 'reassure'; +import { configure as configureRtc } from 'react-test-config'; configure({ testingLibrary: 'react-native', verbose: true, }); -beforeAll(() => { - // part 1 - const React = require('react'); - // __CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE IS the - // ReactSharedInternals object — the same reference React reads internally. - const internals = - React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; - if (internals != null && 'recentlyCreatedOwnerStacks' in internals) { - Object.defineProperty(internals, 'recentlyCreatedOwnerStacks', { - get: () => Infinity, - set: () => {}, - configurable: true, - }); - } +configureRtc({ + enableOwnerStacks: false, +}) - // part 2 - // delete console.createTask; -}); \ No newline at end of file diff --git a/test-apps/native/package.json b/test-apps/native/package.json index 6e22b48a..63c8c774 100644 --- a/test-apps/native/package.json +++ b/test-apps/native/package.json @@ -31,6 +31,7 @@ "eslint": "^10.4.1", "jest": "^30.4.2", "prettier": "^3.8.3", + "react-test-config": "^0.1.0", "reassure": "workspace:^", "test-renderer": "1.2.0", "typescript": "^6.0.3" diff --git a/yarn.lock b/yarn.lock index 5a4d950a..b5bc1a1d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10209,6 +10209,15 @@ __metadata: languageName: node linkType: hard +"react-test-config@npm:^0.1.0": + version: 0.1.0 + resolution: "react-test-config@npm:0.1.0" + peerDependencies: + react: ^19.0.0 + checksum: 10c0/ab5559ceb2900374ea56286b9679ccc6e292acd8611f2bb763c661f64981d15dc508defe4c2887817843e8e7c85c595bd0503d3f4db02896bba6f34103b58f25 + languageName: node + linkType: hard + "react@npm:19.2.3": version: 19.2.3 resolution: "react@npm:19.2.3" @@ -10291,6 +10300,7 @@ __metadata: prettier: "npm:^3.8.3" react: "npm:19.2.3" react-native: "npm:0.85.3" + react-test-config: "npm:^0.1.0" reassure: "workspace:^" test-renderer: "npm:1.2.0" typescript: "npm:^6.0.3"