@ionic/react-test-utils
Test utilities for Ionic React
Last updated 3 months ago by elylucas .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @ionic/react-test-utils 
SYNC missed versions from official npm registry.

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.

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();

Current Tags

  • 0.0.3                                ...           latest (3 months ago)

3 Versions

  • 0.0.3                                ...           3 months ago
  • 0.0.2                                ...           3 months ago
  • 0.0.1                                ...           4 months ago

Copyright 2014 - 2016 © taobao.org |