@marowark/ionic-react-test-utils
TypeScript icon, indicating that this package has built-in type declarations

0.0.5 • Public • Published

Ionic React Test Utils

This is a set of helper methods to make testing easier in Ionic React with React Testing Library and Jest.

Custom ionFireEvent

ionFireEvent extends Testing Library's fireEvent by adding the custom ion* events. This can be used as a drop in replacement for fireEvent or used in conjunction with. forked from ionic-team/ionic-react-test-utils

import { ionFireEvent as fireEvent } from '@ionic/react-test-utils';

...


fireEvent.ionChange(element, 'my text');

mockIonicReact

This 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:

import { mockIonicReact } from "@ionic/react-test-utils";
mockIonicReact();

Package Sidebar

Install

npm i @marowark/ionic-react-test-utils

Weekly Downloads

4

Version

0.0.5

License

MIT

Unpacked Size

18.9 kB

Total Files

18

Last publish

Collaborators

  • marowark