0.3.0 • Published 7 years ago

jest-runner-multi-platform v0.3.0

Weekly downloads
-
License
MIT
Repository
-
Last release
7 years ago

jest-runner-multi-platform

An experimental multi-platform runner for Jest

example

What's it about?

I do want to be sure that rendering (or other stuff) is the same on both (Android and iOS) platforms for RN.

Thats where this jest-runner comes into play! It takes your testcases and calls them two times. Once where it adds jest-setup.android.js and once where it adds jest-setup.ios.js to the setupFiles. In those files you can do whatever you want, but I highly suggest to mock RN-Platform in there, like so:

jest.mock('Platform', () => ({
    OS: 'android',
    Version: 21,
}));

Usage

Install

Install jest(it needs Jest 21+) and jest-runner-multi-platform

Add it to your Jest config

In your package.json

{
  "jest": {
    "runner": "jest-runner-multi-platform"
  }
}

Run Jest

yarn jest