Skip to content

Commit

Permalink
fix: CI flakey unit tests TypeErrors on react-native/jest/setup.js gl…
Browse files Browse the repository at this point in the history
…obal.performance (#8046)

## **Description**

Fix recent CI flakey failing unit tests:
`TypeError: Cannot assign to read only property 'performance' of object
'[object global]'`

Failing at:
https://github.com/facebook/react-native/blob/v0.71.14/jest/setup.js#L20-L22
_Nb: https://github.com/facebook/react-native/blob/v0.72.0/jest/setup.js
404 file no longer exists in this future RN ver_

Reconsider current node/jest/RN vers we're using (see
[issue](facebook/react-native#35701) and
[comment](#8046 (comment))
below)

> it broke between node 18.18 and 18.19 - [Jest relies on
descriptor.writable](https://github.com/jestjs/jest/blob/v28.1.3/packages/jest-environment-node/src/index.ts#L88)
but it's not longer returned in the descriptor

Nb: Node 18.19
[changelog](https://github.com/nodejs/node/blob/main/doc/changelogs/CHANGELOG_V18.md#2023-11-29-version-18190-hydrogen-lts-targos)

## **Related issues**

Fixes: #8051

## **Manual testing steps**

Run unit tests

## **Screenshots/Recordings**

### **Before**

### **After**

## **Pre-merge author checklist**

- [x] I’ve followed [MetaMask Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've clearly explained what problem this PR is solving and how it
is solved.
- [x] I've linked related issues
- [x] I've included manual testing steps
- [x] I've included screenshots/recordings if applicable
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.
- [x] I’ve properly set the pull request status:
  - [x] In case it's not yet "ready for review", I've set it to "draft".
- [x] In case it's "ready for review", I've changed it from "draft" to
"non-draft".

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
  • Loading branch information
leotm authored Dec 8, 2023
1 parent c482c7d commit 9196c02
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v18
18.18
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@
"fs": "react-native-level-fs"
},
"engines": {
"node": "^18.17.1",
"node": "~18.18.2",
"yarn": "^1.22.0"
},
"lavamoat": {
Expand Down

0 comments on commit 9196c02

Please sign in to comment.