callstack / reassure

Performance testing companion for React and React Native
https://callstack.github.io/reassure/
MIT License
1.21k stars 25 forks source link

`yarn reassure` doesn't work with vanilla React Native 0.74.x app #492

Closed jkoutavas closed 1 month ago

jkoutavas commented 2 months ago

Describe the improvement Update the README (the Package?) to handle this situation:

% yarn reassure
Usage Error: Couldn't find a script named "reassure".

$ yarn run [--inspect] [--inspect-brk] [-T,--top-level] [-B,--binaries-only] <scriptName> ...
% yarn --version
3.6.4

package.json

{
  "name": "rn7401",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "lint": "eslint .",
    "start": "react-native start",
    "test": "jest"
  },
  "dependencies": {
    "react": "18.2.0",
    "react-native": "0.74.1"
  },
  "devDependencies": {
    "@babel/core": "^7.20.0",
    "@babel/preset-env": "^7.20.0",
    "@babel/runtime": "^7.20.0",
    "@react-native/babel-preset": "0.74.83",
    "@react-native/eslint-config": "0.74.83",
    "@react-native/metro-config": "0.74.83",
    "@react-native/typescript-config": "0.74.83",
    "@types/react": "^18.2.6",
    "@types/react-test-renderer": "^18.0.0",
    "babel-jest": "^29.6.3",
    "eslint": "^8.19.0",
    "jest": "^29.6.3",
    "prettier": "2.8.8",
    "react-test-renderer": "18.2.0",
    "reassure": "^0.11.0",
    "typescript": "5.0.4"
  },
  "engines": {
    "node": ">=18"
  },
  "packageManager": "yarn@3.6.4"
}
mdjastrzebski commented 2 months ago

This is a known problem that Reassure 0.x has issues with Yarn 3.x and 4.x (you seem to use 3.6.4), but works correctly with Yarn 1.x (classic). This is fixed in the upcoming Reassure 1.0, which is in the Release Candidate version, you can install it with yarn add -D reassure@next.

mdjastrzebski commented 2 months ago

@jkoutavas BTW we also have example app for RN CLI (0.74.1) that you can use as a reference: https://github.com/callstack/reassure-examples/tree/main/examples/native