{"_id":"@ananto/react-test-utils","_rev":"2-8ce4d539ceec46d9de2423ca3d01fc74","name":"@ananto/react-test-utils","dist-tags":{"latest":"0.3.2"},"versions":{"0.3.1":{"name":"@ananto/react-test-utils","version":"0.3.1","main":"dist/index.js","description":"Test utilities for Ionic React","keywords":["ionic","framework","react","testing"],"license":"MIT","repository":{"type":"git","url":"git+https://github.com/ionic-team/ionic-react-test-utils.git"},"typings":"dist/index.d.ts","scripts":{"start":"node scripts/start.js","build":"npm run clean && npm run transpile","rollup":"rollup --config rollup.config.js","transpile":"tsc","clean":"rimraf dist","build-old":"node scripts/build.js","test":"jest"},"eslintConfig":{"extends":"react-app"},"peerDependencies":{"@ionic/react":"*","@testing-library/react":"*","jest":"*","react":"*"},"devDependencies":{"@ionic/react":"^4.11.10","@testing-library/jest-dom":"^5.0.2","@testing-library/react":"^9.4.0","@types/jest":"^24.0.23","@types/react-test-renderer":"^16.9.1","conventional-changelog":"^3.1.4","jest":"^24.9.0","jest-environment-jsdom-fourteen":"^0.1.0","react":"^16.11.0","react-app-polyfill":"^1.0.4","react-test-renderer":"^16.11.0","replace":"^1.1.0","rimraf":"^2.6.1","ts-jest":"^24.1.0","tslint":"^5.6.0","typedoc":"^0.14.2","typescript":"^3.7.4","uglify-js":"^3.2.0"},"jest":{"preset":"ts-jest","setupFilesAfterEnv":["<rootDir>/jest.setup.js"],"testPathIgnorePatterns":["node_modules","dist-transpiled","dist","test-app"],"modulePaths":["<rootDir>"]},"gitHead":"b66da0f30ba1fa970df9bcc88fa5967fc210c0d6","bugs":{"url":"https://github.com/ionic-team/ionic-react-test-utils/issues"},"homepage":"https://github.com/ionic-team/ionic-react-test-utils#readme","_id":"@ananto/react-test-utils@0.3.1","_nodeVersion":"16.14.2","_npmVersion":"8.5.0","dist":{"integrity":"sha512-I0m8fWYNy/Fhp7xfchV/cJWNKOj20WAmvGjxrffB8P3gPf7d8uoru+j67UOAKFSdkLDfcgLcrNph/4RAB7F3rA==","shasum":"a096ce7a2a4f9f10fd53d5d86940d0ef081aba37","tarball":"https://registry.npmjs.org/@ananto/react-test-utils/-/react-test-utils-0.3.1.tgz","fileCount":24,"unpackedSize":30463,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFzFpnIQiB9intzevifS/95WJXQOxcuZaurGG2xFBIEjAiEAmqaiE0Ij3YgQmICfEIoKi3j4R+8Qxul0OtIV7psz0hA="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjQ7pzACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmquFA//eUDkmCXcxMcTZoHg4CayPc1HJsGIRnL4pZ/lBljVJOo9qoU5\r\npPh0NROOzOQpPHJlXFLqxKJlHqc79op54hYO5Mre6axsW+bb57BMXFfoMb0I\r\n6o0Y7zWofWA1/J6FmXUcvzniPqO4afP9BTYfAK2WVz7JNvulUZ0z+wc5RyuW\r\n4cz89geE1NicrXvSW9GurC4IQT67KP9CcoAdB903abBXXRhckDtAXDpSGPU0\r\nQDVk9XpwkqW76nOafWcwtftxgajU9eQ9mbeHntvByuqHt9AxDGV8M42W7ehP\r\njNR3DV42HqeUjVZJlXhyf4z5SGxCLDGPk8fptcgmCVPk/uIkn7soAIY4LSNI\r\nACRm+qJsJSTqFMhu2Yhb2jrOP1vieIHQgvIN+xz3a5bd0PnEaSg4t7oCMqdg\r\nSmWtI07JUmzWYo4nCS9cpU9UVRszQrNCBYCYqfvlp27AH8p49tjU0XV6ITAZ\r\nf5az4AEOq4oOXLgp7O+dDJdc4aE7xRH3vqiQ0e8RUjujTu/7JCPzPwArQR+9\r\n0uU8sp++Q5c4sWngz5jKRWpET+aV7oU3nR2qhlttEJo8tGZOLBOBX185BXof\r\no0s7gnpwHUTHbuh5sLnAC0nzICu8FwcbKZamMt+fATEcTl2XDFg26WL3s5HH\r\nncxhQ3FkZTIdZ3sSaKjCwyR8soCQPaUpq/4=\r\n=rTpC\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"anantoghosh","email":"a0ghosh+npmjs@googlemail.com"},"directories":{},"maintainers":[{"name":"anantoghosh","email":"a0ghosh+npmjs@googlemail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-test-utils_0.3.1_1665383027700_0.7521632627631789"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.3.2":{"name":"@ananto/react-test-utils","version":"0.3.2","main":"dist/index.js","description":"Test utilities for Ionic React","keywords":["ionic","framework","react","testing"],"license":"MIT","repository":{"type":"git","url":"git+https://github.com/ionic-team/ionic-react-test-utils.git"},"typings":"dist/index.d.ts","scripts":{"start":"node scripts/start.js","build":"npm run clean && npm run transpile","rollup":"rollup --config rollup.config.js","transpile":"tsc","clean":"rimraf dist","build-old":"node scripts/build.js","test":"jest"},"eslintConfig":{"extends":"react-app"},"peerDependencies":{"@ionic/react":"*","@testing-library/react":"*","jest":"*","react":"*"},"devDependencies":{"@ionic/react":"^4.11.10","@testing-library/jest-dom":"^5.0.2","@testing-library/react":"^9.4.0","@types/jest":"^24.0.23","@types/react-test-renderer":"^16.9.1","conventional-changelog":"^3.1.4","jest":"^24.9.0","jest-environment-jsdom-fourteen":"^0.1.0","react":"^16.11.0","react-app-polyfill":"^1.0.4","react-test-renderer":"^16.11.0","replace":"^1.1.0","rimraf":"^2.6.1","ts-jest":"^24.1.0","tslint":"^5.6.0","typedoc":"^0.14.2","typescript":"^3.7.4","uglify-js":"^3.2.0"},"jest":{"preset":"ts-jest","setupFilesAfterEnv":["<rootDir>/jest.setup.js"],"testPathIgnorePatterns":["node_modules","dist-transpiled","dist","test-app"],"modulePaths":["<rootDir>"]},"gitHead":"d16875d89d659aa961a76cf4d9b966fc511faae8","bugs":{"url":"https://github.com/ionic-team/ionic-react-test-utils/issues"},"homepage":"https://github.com/ionic-team/ionic-react-test-utils#readme","_id":"@ananto/react-test-utils@0.3.2","_nodeVersion":"16.14.2","_npmVersion":"8.5.0","dist":{"integrity":"sha512-FOChhyAODzQfVV69TpTNihEFzp4Th44KLOAwp4RLBRlDaK8Z+iseHmHvOd4qFl8oXyesrdIFHE9jtMIygDifag==","shasum":"75430731d49618b4d4567fa9039c70b1f67f534c","tarball":"https://registry.npmjs.org/@ananto/react-test-utils/-/react-test-utils-0.3.2.tgz","fileCount":24,"unpackedSize":30406,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGllp/g4gLppPpXVP6TiScjpcK6I30vByouaYGM2XufKAiEAkSSD4eEpprAnYbcr9hMYp+m80YzPunfAs5t7phBtNgM="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjQ7veACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmomUw/+Oj3883954He608H81TtGVKW/oolDAv6+p7nHLkXJnP6bA596\r\nSxe4bSm1AiAl0JVjTvxBpO7ZoZxEgDrHW3rpBcSLDzZ7DE/2RhIcGFLmPFnQ\r\nFMKLdPdgFv2BaK5v77BTnI8uKNB6FcUGWx0wUTu+uBtOpCMfbUV35NaDCNOq\r\njbcq2tsRHsH+vRVJ8b/SNfZ+mXuStdchO1nWYNRg84fngNqgKlDoEFYIvZe9\r\n9IsM8+r7OpafusL+OMI10N8NO1eUyI5VByJcBCmnIcwcbX+BMfU9VrdeEBFt\r\nj8tejDHtfWWu2ng6TGq17UYn9yidHEIYRhSSy0hf47JO1SV88Rk1y8hTWGdL\r\npAueNXWD9O6sjnPCfMQd1S7n+SsQtToHzolbAFZzTWHb6TGFmfLP2EufW/8d\r\nwfbhmEvWTe20GtkAJVp4/wHXml3ti9PvKUU7TQxvlqQ8T3AhUxnTlrVYpUdE\r\nlWmR4wzAiZXsS8PzgA6tXuPll21zV+0OSmoZN+OLSsN9tnred/HP5XJf/CM6\r\nLGxra1y6+msN83chnjaQpQObbHEI3ne5W0SWQlJMsW2GSXQnRySY62Y7NNhV\r\nlBYJ+HFdE7lKPoEOz/UXkizhpl1I96FYr0MTUKjp47k6q+5Ak9B7tBShFmTe\r\n9f83/wXhgBNQu6lhMwNyog693vbsQyrMa/4=\r\n=OLfM\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"anantoghosh","email":"a0ghosh+npmjs@googlemail.com"},"directories":{},"maintainers":[{"name":"anantoghosh","email":"a0ghosh+npmjs@googlemail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-test-utils_0.3.2_1665383390301_0.6228281323177383"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."}},"time":{"created":"2022-10-10T06:23:47.638Z","0.3.1":"2022-10-10T06:23:47.844Z","modified":"2022-10-13T08:00:35.830Z","0.3.2":"2022-10-10T06:29:50.537Z"},"maintainers":[{"name":"anantoghosh","email":"a0ghosh+npmjs@googlemail.com"}],"description":"Test utilities for Ionic React","homepage":"https://github.com/ionic-team/ionic-react-test-utils#readme","keywords":["ionic","framework","react","testing"],"repository":{"type":"git","url":"git+https://github.com/ionic-team/ionic-react-test-utils.git"},"bugs":{"url":"https://github.com/ionic-team/ionic-react-test-utils/issues"},"license":"MIT","readme":"# Ionic React Test Utils (fork)\n\nThis is a fork of https://github.com/ionic-team/ionic-react-test-utils, which fixes https://github.com/ionic-team/ionic-react-test-utils/issues/18.\n\nThis package is a drop in replacement and will be deprecated when upstream fixes the issue.\n\nReplace `@ionic/react-test-utils` with `@ananto/react-test-utils`.\n\n---\n\nThis is a set of helper methods to make testing easier in Ionic React with React Testing Library and Jest.\n\n## Installation\n\n```\nyarn add -D @ionic/react-test-utils\n```\n\nor\n\n```\nnpm install --dev @ionic/react-test-utils\n```\n\n## Custom ionFireEvent\n\n`ionFireEvent` extends [Testing Library's](https://testing-library.com/docs/dom-testing-library/api-events) `fireEvent` by adding the custom `ion*` events. This can be used as a drop in replacement for `fireEvent` or used in conjunction with.\n\n```javascript\nimport { ionFireEvent as fireEvent } from '@ionic/react-test-utils';\n\n...\n\n\nfireEvent.ionChange(element, 'my text');\n```\n\n## mockIonicReact\n\nThis method mocks out certain Ionic components that have issues rendering in JSDOM. To use it, open up `setupTests.ts` and add this to the file:\n\n```javascript\nimport { mockIonicReact } from '@ionic/react-test-utils';\nmockIonicReact();\n```\n\nIf you are using Ionic v6, you will also need to call `setupIonicReact`:\n\n```js\nimport { mockIonicReact } from '@ionic/react-test-utils';\nimport { setupIonicReact } from '@ionic/react';\n\nsetupIonicReact();\nmockIonicReact();\n```\n\n## waitForIonicReact\n\nThis function waits for Ionic React to be fully initialized. Use this in any test that renders Ionic components, to ensure the rendered markup has all classes etc. that Ionic adds at runtime.\n\n```jsx\nimport { render } from '@testing-library/react';\nimport { waitForIonicReact } from '@ionic/react-test-utils';\nimport MyComponent from './MyComponent';\n\ndescribe('<MyComponent />', () => {\n  it('renders consistently', async () => {\n    const { baseElement } = render(<MyComponent/>);\n    await waitForIonicReact();\n    expect(baseElement).toMatchSnapshot();\n  });\n});\n```\n\n`waitForIonicReact` waits for the DOM to be stable, meaning no markup has changed for a certain period of time. This period is determined by the first parameter, `timeout`, which defaults to 750 milliseconds. There is also a global timeout determined by the second parameter, `maxWaitTime`. This defaults to 5000 milliseconds (five seconds) and, if hit, will cause the function to fail early. If you find your tests are running too slow or not detecting all Ionic behaviors, try tweaking these values.","readmeFilename":"README.md"}