Skip to content

Commit 48f9036

Browse files
authored
docs(readme): Add time difference (#21)
1 parent 1423234 commit 48f9036

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ React Native mocks for testing. It is the same as the internal Jest-based mocks
1616

1717
Testing on React Native is not such a trivial task, mainly because some modules and components communicate directly to native code (iOS, Android, etc.) However, in a testing environment like Node.js, the native code is unavailable. Also, React Native code is not delivered in a distributable manner -- most of the code in Flow, and some modules need to go through a haste map resolver (modules with `.ios.js` and `.android.js` prefix, required without the prefix).
1818

19-
React Native solves this problem with [Jest](https://jestjs.io/), providing Jest mocks for native modules. Jest transpiles the code before running it, so there's also a Flow preset in the configuration and some settings to solve the haste map. React Native then exports this configuration as a [Jest preset](https://github.com/facebook/react-native/blob/main/packages/react-native/jest-preset.js) for developers to use with their Jest configuration.
19+
React Native solves this problem through [Jest](https://jestjs.io/), providing Jest mocks for native modules. Jest transpiles the code before running it, so there's also a Flow preset in the configuration and some settings to solve the haste map. React Native then exports this configuration as a [Jest preset](https://github.com/facebook/react-native/blob/main/packages/react-native/jest-preset.js) for developers to use with their Jest configuration.
2020

2121
But what if you don't want to use Jest as your testing framework? What if you don't need Babel because you already have TypeScript, and your test can run on [ts-node](https://typestrong.org/ts-node/)? Is it even possible to test React Native code without Jest? This package aims to solve this problem by providing mocks the same way as React Native does but without Jest dependency in the middle. It solves the "haste map" modules and transforms Flow code on the fly, caching the result so subsequent executions are 6x faster. Overall, the package makes it possible to test React Native in other frameworks, like [Mocha.js](https://mochajs.org/).
2222

@@ -33,7 +33,9 @@ But what if you don't want to use Jest as your testing framework? What if you do
3333

3434
### Features
3535

36-
- Fast and simple. Transforms just what it needs, when it needs.
36+
- Fast and simple. It transforms just what it needs when it needs it.
37+
- **6x** faster _before_ cache.
38+
- **12x** faster _after_ cache.
3739
- Compatible with [@testing-library/react-native](https://callstack.github.io/react-native-testing-library/) renderer.
3840
- Extensive range of compatibility by imitating React Native's original mocks.
3941
- Testing framework agnostic.

0 commit comments

Comments
 (0)