Skip to content

Commit

Permalink
Integration with Jest (software-mansion#1731)
Browse files Browse the repository at this point in the history
## Description

Integration Reanimated2 with Jest testing. As mocks use implementation from the web version of Renimated2.

## Usage

To correct run of tests is required to add `require('<path_to>/reanimated2/jestUtils').SetUpTests();` in `jest.setup.js`

## Test code and steps to reproduce
The tests are located: [here](https://github.com/software-mansion/react-native-reanimated/tree/__tests__)
To run tests:
```
cd ./Example && yarn jest
```
  • Loading branch information
piaskowyk authored Mar 1, 2021
1 parent 52de2a9 commit 0a99fdd
Show file tree
Hide file tree
Showing 27 changed files with 2,430 additions and 1,863 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,6 @@ module.exports = {
},
],
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
'@typescript-eslint/no-var-requires': 'warn',
},
};
8 changes: 4 additions & 4 deletions Example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -433,10 +433,10 @@ EXTERNAL SOURCES:

SPEC CHECKSUMS:
boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c
DoubleConversion: 5805e889d232975c086db112ece9ed034df7a0b2
DoubleConversion: cf9b38bf0b2d048436d9a82ad2abe1404f11e7de
FBLazyVector: b21700af840f633338ac968a36da9aa3a8268887
FBReactNativeSpec: c6aa507df7d4d07fd16a910a5265ca59c2761d91
glog: 1f3da668190260b06b429bb211bfbee5cd790c28
FBReactNativeSpec: b50637f2114c289c2f5f82ad075a3bcc4e2280c4
glog: 73c2498ac6884b13ede40eda8228cb1eee9d9d62
RCT-Folly: ec7a233ccc97cc556cf7237f0db1ff65b986f27c
RCTRequired: fa44b153ba69cb9dd6cec5084b86719e3be7c90b
RCTTypeSafety: 8e815e0f29ed65901e4e2963a90063a4cfcb7d5e
Expand Down Expand Up @@ -470,4 +470,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: 134567898248f45bf80ce9764e5986525ca64d51

COCOAPODS: 1.9.3
COCOAPODS: 1.10.0
7 changes: 2 additions & 5 deletions Example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,13 @@
"glob-to-regexp": "^0.4.0",
"immutable": "^4.0.0-rc.12",
"jasmine-core": "^3.5.0",
"jest": "^24.9.0",
"jest": "^26.6.3",
"metro-react-native-babel-preset": "^0.64.0",
"postinstall-postinstall": "^2.1.0",
"react-native-codegen": "^0.0.6",
"react-test-renderer": "17.0.1"
},
"jest": {
"preset": "react-native"
},
"resolutions": {
"@babel/runtime": "7.6.0"
"@babel/runtime": "7.12.13"
}
}
Loading

0 comments on commit 0a99fdd

Please sign in to comment.