{"_id":"react-test-config","_rev":"4-7336c15d9c763b3b5451627bfd5009ef","name":"react-test-config","dist-tags":{"latest":"1.0.0"},"versions":{"0.1.0":{"name":"react-test-config","version":"0.1.0","keywords":["react","testing","jest","owner-stacks"],"author":"","license":"MIT","_id":"react-test-config@0.1.0","maintainers":[{"name":"mdjastrzebski","email":"mdjastrzebski@gmail.com"}],"dist":{"shasum":"eddc3340cf429b11352ddebcb5c080e46275e93d","tarball":"https://registry.npmjs.org/react-test-config/-/react-test-config-0.1.0.tgz","fileCount":9,"integrity":"sha512-KRAmLPL8KPPfwvykUFAM4ANij95BTXNbP3nrndofuinbkbmPROWGXaMwkMGjUda9Knin0rrRWmY0DBxTZVVRMQ==","signatures":[{"sig":"MEUCIQDhAv0pMjnuYe5RMcyP2eRSSAMSCRWuZs8RFPKFSGqpDAIgGpT6Hdm8A8w5Y/O3U6aQuIHduBJxNN6WTyziXVSqyxo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":9506},"main":"./dist/index.cjs","types":"./dist/index.d.cts","module":"./dist/index.mjs","exports":{".":{"import":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"gitHead":"fac1a4da388093b2f5f66be441daf2c6434ed166","scripts":{"dev":"tsdown --watch","build":"tsdown","release":"release-it","typecheck":"tsc --noEmit"},"_npmUser":{"name":"mdjastrzebski","email":"mdjastrzebski@gmail.com"},"_npmVersion":"10.9.2","description":"Configure React testing environment","directories":{},"_nodeVersion":"22.17.1","_hasShrinkwrap":false,"packageManager":"pnpm@10.33.2","devDependencies":{"react":"^19.0.0","unrun":"^0.3.1","tsdown":"^0.22.0","release-it":"^20.2.0","typescript":"^5.0.0","@types/react":"^19.0.0","@release-it/conventional-changelog":"^11.0.1"},"peerDependencies":{"react":"^19.0.0"},"_npmOperationalInternal":{"tmp":"tmp/react-test-config_0.1.0_1781254351106_0.42327226323769285","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"react-test-config","version":"0.2.0","keywords":["react","testing","jest","owner-stacks"],"author":"","license":"MIT","_id":"react-test-config@0.2.0","maintainers":[{"name":"mdjastrzebski","email":"mdjastrzebski@gmail.com"}],"dist":{"shasum":"7aeefa8f459b4372116245d19e7169c33a214264","tarball":"https://registry.npmjs.org/react-test-config/-/react-test-config-0.2.0.tgz","fileCount":9,"integrity":"sha512-D5rdfUEfqTMjK3nFliam7I3gQh3StfvoCYa0+9OKvT0ieQLXD93elwsRl3HwFZaH0ihk49aqN5pQZ7FbtlpQoQ==","signatures":[{"sig":"MEQCIF7TvlKWqFdK/BZIYjk1Zg4ZWOJbMV2kvvD8udb+1FLPAiA6t3nBpnLkqUbtGHtilArweqrRRh2vaCNbvuWF9xBohA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":8674},"main":"./dist/index.cjs","types":"./dist/index.d.cts","module":"./dist/index.mjs","exports":{".":{"import":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"gitHead":"6983656e64b405c48bea4a0df14c4958301a51f2","scripts":{"dev":"tsdown --watch","build":"tsdown","release":"release-it","typecheck":"tsc --noEmit"},"_npmUser":{"name":"mdjastrzebski","email":"mdjastrzebski@gmail.com"},"_npmVersion":"10.9.2","description":"Configure React testing environment","directories":{},"_nodeVersion":"22.17.1","_hasShrinkwrap":false,"packageManager":"pnpm@10.33.2","devDependencies":{"react":"^19.0.0","unrun":"^0.3.1","tsdown":"^0.22.0","release-it":"^20.2.0","typescript":"^5.0.0","@types/react":"^19.0.0","@release-it/conventional-changelog":"^11.0.1"},"peerDependencies":{"react":"^19.0.0"},"_npmOperationalInternal":{"tmp":"tmp/react-test-config_0.2.0_1781386315378_0.14434478694976516","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"react-test-config","version":"0.3.0","keywords":["jest","owner-stacks","react","testing"],"author":"","license":"MIT","_id":"react-test-config@0.3.0","maintainers":[{"name":"mdjastrzebski","email":"mdjastrzebski@gmail.com"}],"dist":{"shasum":"dbbc756560f05b92a79d40a4dd57c0752840745c","tarball":"https://registry.npmjs.org/react-test-config/-/react-test-config-0.3.0.tgz","fileCount":9,"integrity":"sha512-AYR2csEp55RIA4JKQjYz5cpGN5oB8CTmqtoFLJkiI9Wyqe+a+uyAq3OuoKXTM1alUN90YfgJb3YB+oU+eT9yPQ==","signatures":[{"sig":"MEQCICvcqmoDblYMp/gqYMi86t1HDgIt1G4VoWDk7wufceV9AiBTauZpKoiSJl2HjHgvhBiuGoGb6bo09kJx8AwedjYxLA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":10181},"main":"./dist/index.cjs","types":"./dist/index.d.cts","module":"./dist/index.mjs","exports":{".":{"import":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"gitHead":"df249d55ee6e73092399f02fbcc185c1b09e2d50","scripts":{"dev":"tsdown --watch","build":"tsdown","format":"oxfmt .","release":"release-it","typecheck":"tsc --noEmit","validate:fix":"pnpm typecheck && pnpm format"},"_npmUser":{"name":"mdjastrzebski","email":"mdjastrzebski@gmail.com"},"_npmVersion":"10.9.2","description":"Configure React testing environment","directories":{},"_nodeVersion":"22.14.0","_hasShrinkwrap":false,"packageManager":"pnpm@11.6.0+sha512.9a36518224080c6fe5165afdcfe79bfa118c29be703f3f462b1e32efe1e98e47e8750b148e08286250aad4113cc7993ca413c4e2cd447752708c2ee5751bc95f","devDependencies":{"oxfmt":"^0.54.0","react":"^19.0.0","unrun":"^0.3.1","tsdown":"^0.22.0","release-it":"^20.2.0","typescript":"^5.0.0","@types/node":"24.1.0","@types/react":"^19.0.0","@release-it/conventional-changelog":"^11.0.1"},"peerDependencies":{"react":"^19.0.0"},"_npmOperationalInternal":{"tmp":"tmp/react-test-config_0.3.0_1781431005329_0.8845425984085795","host":"s3://npm-registry-packages-npm-production"}},"1.0.0":{"name":"react-test-config","version":"1.0.0","description":"Configure React testing environment","keywords":["jest","owner-stacks","react","testing"],"license":"MIT","author":"","main":"./dist/index.cjs","module":"./dist/index.mjs","types":"./dist/index.d.cts","exports":{".":{"import":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"scripts":{"build":"tsdown","dev":"tsdown --watch","format":"oxfmt .","format:check":"oxfmt --check .","test":"jest --watchman=false","typecheck":"tsc --noEmit","validate":"node --run test && node --run typecheck && node --run format:check","validate:fix":"node --run format && node --run typecheck && node --run test","release":"release-it"},"devDependencies":{"@babel/core":"^7.29.7","@babel/preset-env":"^7.29.7","@babel/preset-typescript":"^7.29.7","@release-it/conventional-changelog":"^11.0.1","@types/node":"24.1.0","@types/react":"^19.0.0","babel-jest":"^29.7.0","jest":"^29.7.0","oxfmt":"^0.54.0","react":"^19.0.0","release-it":"^20.2.0","tsdown":"^0.22.0","typescript":"^5.0.0","unrun":"^0.3.1"},"peerDependencies":{"react":"*"},"packageManager":"pnpm@11.6.0+sha512.9a36518224080c6fe5165afdcfe79bfa118c29be703f3f462b1e32efe1e98e47e8750b148e08286250aad4113cc7993ca413c4e2cd447752708c2ee5751bc95f","_id":"react-test-config@1.0.0","gitHead":"72dce4efbf85b8ff01de87eb7a209cda0b01e5cc","_nodeVersion":"22.17.1","_npmVersion":"10.9.2","dist":{"integrity":"sha512-uoYlGns8YSB/FS0aAzUVg/wgS4z882rygig4gcwf0hEzAWEM6O2zN2r3gYLyYwm8MMRuqwLUOBWWq60K5/pBPQ==","shasum":"bd20a471aaddaca1f3d4d1abf64f9af30790d4c7","tarball":"https://registry.npmjs.org/react-test-config/-/react-test-config-1.0.0.tgz","fileCount":9,"unpackedSize":12126,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIH/5iT73GjFmIr3UiNNrxBkFbE4pIyfwwwYknIIn6V+KAiEAppj6Zx7xxTAqWebtlm30804G0/m+8vjYkXfcxKaIx2I="}]},"_npmUser":{"name":"mdjastrzebski","email":"mdjastrzebski@gmail.com"},"directories":{},"maintainers":[{"name":"mdjastrzebski","email":"mdjastrzebski@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/react-test-config_1.0.0_1782379602725_0.9358345284941001"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-12T08:52:30.804Z","modified":"2026-06-25T09:26:42.972Z","0.1.0":"2026-06-12T08:52:31.240Z","0.2.0":"2026-06-13T21:31:55.512Z","0.3.0":"2026-06-14T09:56:45.488Z","1.0.0":"2026-06-25T09:26:42.871Z"},"license":"MIT","keywords":["jest","owner-stacks","react","testing"],"description":"Configure React testing environment","maintainers":[{"name":"mdjastrzebski","email":"mdjastrzebski@gmail.com"}],"readme":"# react-test-config\n\nConfigure the React testing environment for improved performance.\n\n## What it does\n\nReact 19 collects owner stacks (component stack traces) on every render. This is useful for debugging in development, but adds measurable overhead during tests. `react-test-config` disables this behaviour so your test suite runs faster.\n\n## Installation\n\n```sh\nnpm install --save-dev react-test-config\n# or\nyarn add --dev react-test-config\n# or\npnpm add --save-dev react-test-config\n```\n\n**Peer dependency:** React (`react@*`).\n\n## Usage\n\nCall `disableOwnerStacks()` once, before your tests run. The right place is a setup file that your test runner loads before the test suite.\n\nTo disable owner-stack collection:\n\n```ts\nimport { disableOwnerStacks } from 'react-test-config';\n\ndisableOwnerStacks();\n```\n\n### Jest\n\nAdd the setup file to `jest.config.js`:\n\n```js\nmodule.exports = {\n  setupFiles: ['./jest.setup.ts'],\n};\n```\n\n### Vitest\n\nAdd the setup file to `vitest.config.ts`:\n\n```ts\nexport default {\n  test: {\n    setupFiles: ['./vitest.setup.ts'],\n  },\n};\n```\n\n## Recommended with\n\nThis package is particularly useful when testing React Native and React applications with:\n\n- [React Native Testing Library](https://github.com/callstack/react-native-testing-library) — testing utilities for React Native\n- [React Testing Library](https://github.com/testing-library/react-testing-library) — testing utilities for React DOM\n- [Reassure](https://github.com/callstack/reassure) — performance regression testing for React and React Native. Disabling owner stacks stabilises measurement results and resolves [bimodal test result distributions](https://github.com/callstack/reassure/issues/585) caused by React's stack collection overhead\n\n## Configuration\n\n### `RTC_SKIP_DISABLE_OWNER_STACKS`\n\nSet this environment variable to any truthy value to make `disableOwnerStacks()` a no-op. This is useful when you want to temporarily re-enable owner stacks — for example, to debug a component hierarchy without changing your setup file.\n\n```sh\nRTC_SKIP_DISABLE_OWNER_STACKS=1 npx jest\n```\n\n## API\n\n### `disableOwnerStacks()`\n\nDisables React's owner-stack collection by forcing React's internal `recentlyCreatedOwnerStacks` value to `Infinity`. This only runs on React 19.1 and newer, and respects the [`RTC_SKIP_DISABLE_OWNER_STACKS`](#rtc_skip_disable_owner_stacks) environment variable.\n\n## License\n\nMIT\n","readmeFilename":"README.md"}