Skip to content

Commit

Permalink
chore: update reassure 1.0 beta (#35)
Browse files Browse the repository at this point in the history
* chore(native-expo): upgrade reassure to 1.0-beta

* chore(native-expo): upgrade expo

* chore(native): recreate from CLI, upgrade reassure to v1.0

* chore: restore yarn.lock
  • Loading branch information
mdjastrzebski authored May 15, 2024
1 parent c963b0d commit a9e0aad
Show file tree
Hide file tree
Showing 65 changed files with 3,853 additions and 1,721 deletions.
11 changes: 6 additions & 5 deletions examples/native-expo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "native-expo",
"version": "1.0.0",
"main": "node_modules/expo/AppEntry.js",
"license": "MIT",
"scripts": {
"start": "expo start",
"android": "expo start --android",
Expand All @@ -12,19 +13,19 @@
"typecheck": "tsc --noEmit"
},
"dependencies": {
"expo": "~49.0.13",
"expo-status-bar": "~1.6.0",
"expo": "^49.0.21",
"expo-status-bar": "~1.7.1",
"react": "18.2.0",
"react-native": "0.72.5"
"react-native": "0.72.6"
},
"devDependencies": {
"@babel/core": "^7.20.0",
"@testing-library/react-native": "^12.3.0",
"@testing-library/react-native": "^12.4.3",
"@types/jest": "^29.5.5",
"@types/react": "^18.2.28",
"jest": "^29.7.0",
"react-test-renderer": "^18.2.0",
"reassure": "^0.10.0",
"reassure": "^1.0.0-beta",
"typescript": "^5.2.2"
},
"private": true
Expand Down
46 changes: 46 additions & 0 deletions examples/native-expo/src/AsyncComponent.perf-test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import * as React from 'react';
import { View, Text, Pressable } from 'react-native';
import { screen, fireEvent } from '@testing-library/react-native';
import { measureRenders } from 'reassure';
import { SlowList } from './SlowList';

jest.setTimeout(60_000);

const AsyncComponent = () => {
const [count, setCount] = React.useState(0);

const handlePress = () => {
setTimeout(() => setCount((c) => c + 1), 10);
};

return (
<View>
<Pressable accessibilityRole="button" onPress={handlePress}>
<Text>Action</Text>
</Pressable>

<Text>Count: {count}</Text>

<SlowList count={200} />
</View>
);
};

test('Async Component', async () => {
const scenario = async () => {
const button = screen.getByText('Action');

fireEvent.press(button);
await screen.findByText('Count: 1');

fireEvent.press(button);
await screen.findByText('Count: 2');

fireEvent.press(button);
fireEvent.press(button);
fireEvent.press(button);
await screen.findByText('Count: 5');
};

await measureRenders(<AsyncComponent />, { scenario });
});
42 changes: 3 additions & 39 deletions examples/native-expo/src/SlowList.perf-test.tsx
Original file line number Diff line number Diff line change
@@ -1,45 +1,9 @@
import * as React from 'react';
import { View, Text, Pressable } from 'react-native';
import { screen, fireEvent } from '@testing-library/react-native';
import { measurePerformance } from 'reassure';
import { measureRenders } from 'reassure';
import { SlowList } from './SlowList';

const AsyncComponent = () => {
const [count, setCount] = React.useState(0);

const handlePress = () => {
setTimeout(() => setCount((c) => c + 1), 10);
};

return (
<View>
<Pressable accessibilityRole="button" onPress={handlePress}>
<Text>Action</Text>
</Pressable>

<Text>Count: {count}</Text>

<SlowList count={200} />
</View>
);
};

jest.setTimeout(60_000);
test('Async Component', async () => {
const scenario = async () => {
const button = screen.getByText('Action');

fireEvent.press(button);
await screen.findByText('Count: 1');

fireEvent.press(button);
await screen.findByText('Count: 2');

fireEvent.press(button);
fireEvent.press(button);
fireEvent.press(button);
await screen.findByText('Count: 5');
};

await measurePerformance(<AsyncComponent />, { scenario });
test('SlowList Component', async () => {
await measureRenders(<SlowList count={500} />);
});
133 changes: 70 additions & 63 deletions examples/native-expo/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1175,45 +1175,45 @@
resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==

"@callstack/reassure-cli@0.10.0":
version "0.10.0"
resolved "https://registry.yarnpkg.com/@callstack/reassure-cli/-/reassure-cli-0.10.0.tgz#35d80044fa3e439e173935eaac36d70662eeed8e"
integrity sha512-CYgOGOAWcFgA2GrJw6RJAvImCpHCpPbtPoYMDol7esjlRCX2QwIKG7/9byq47hML57w94fhFAa76KD84YlgMBg==
"@callstack/reassure-cli@1.0.0-beta":
version "1.0.0-beta"
resolved "https://registry.yarnpkg.com/@callstack/reassure-cli/-/reassure-cli-1.0.0-beta.tgz#1cd0f7b655395d3b1783098e57a639cb585aba30"
integrity sha512-aIxC7o6OJAd4+1IvE7aA0TB3b4KGM37TxcsR+O0szT8fHIu42HW4c8MiXj6FQ8HU6+Bo+f4J7vaPOvi3CR9YrQ==
dependencies:
"@callstack/reassure-compare" "0.6.0"
"@callstack/reassure-logger" "0.3.1"
"@callstack/reassure-compare" "1.0.0-beta"
"@callstack/reassure-logger" "1.0.0-beta"
chalk "4.1.2"
simple-git "^3.16.0"
yargs "^17.6.2"

"@callstack/reassure-compare@0.6.0":
version "0.6.0"
resolved "https://registry.yarnpkg.com/@callstack/reassure-compare/-/reassure-compare-0.6.0.tgz#d20f1c239a8c2e66ef6ab1228b7e17a02ebf8c8a"
integrity sha512-P3nmv36CJrQSXg0+z6EuEV/0xAbvxWbAZ7diQHnkbvqk2z8PKRXpkcthrRUpe02wLewa0MLxBUJwLenFnhxIRg==
"@callstack/reassure-compare@1.0.0-beta":
version "1.0.0-beta"
resolved "https://registry.yarnpkg.com/@callstack/reassure-compare/-/reassure-compare-1.0.0-beta.tgz#3aa006b0c3e8bf55cb9e33c45560b9ed39ad73a0"
integrity sha512-3VOwaMHYftoYPyCQ4X+z27fXf/mW0d8z8PRwE9Vh0z6bj8AxtqvdUAuORBuAPMUaG70Dzy76EyxWs2gGSUqaPQ==
dependencies:
"@callstack/reassure-logger" "0.3.1"
"@callstack/reassure-logger" "1.0.0-beta"
markdown-builder "^0.9.0"
markdown-table "^2.0.0"
zod "^3.20.2"

"@callstack/reassure-danger@0.1.1":
version "0.1.1"
resolved "https://registry.yarnpkg.com/@callstack/reassure-danger/-/reassure-danger-0.1.1.tgz#e3aa581dc8b698c18ecb6eb15d7759fdcba5d8a4"
integrity sha512-lfza+qBdvVYtP7WvMTT+LfjBfuYsXZ4RxuBldsL8wJArGeCl3OZwUg+9bTo8v6kk/nY8memk5HxrCwWDSO24UA==
"@callstack/reassure-danger@1.0.0-beta":
version "1.0.0-beta"
resolved "https://registry.yarnpkg.com/@callstack/reassure-danger/-/reassure-danger-1.0.0-beta.tgz#77bdad488900d80989b4a01f44296b3f9a23487b"
integrity sha512-LhlD9Ic9zxr1OLQX2uJTr/it5mr/f4zczYUTSSF1SVqWSYD1HP8daXE+LKiXIF2FmuKuKcN7tSDsIwLUwDAxbQ==

"@callstack/reassure-logger@0.3.1":
version "0.3.1"
resolved "https://registry.yarnpkg.com/@callstack/reassure-logger/-/reassure-logger-0.3.1.tgz#c09a3acf6fecbfc3ddc3762a6d1d1da8ded4d53a"
integrity sha512-IUsNrxVMdt0zgD2IN2snGVGUG8Yc6F3SWaPF8RXUn8qi7XZuYC6WevEL+mIKmlbTTa7qlX9brkn0pJoXAjfcPQ==
"@callstack/reassure-logger@1.0.0-beta":
version "1.0.0-beta"
resolved "https://registry.yarnpkg.com/@callstack/reassure-logger/-/reassure-logger-1.0.0-beta.tgz#75fe2dca4d90cbad997d08a1908afd4a0d8de834"
integrity sha512-uT14UYp225vGvk9RydVGZkad2JXQZiTRCSmffWg7x0kLEAOmZmOtlZ/FLAYauAIzdaI+3cuod85DM6JPr9LCWg==
dependencies:
chalk "4.1.2"

"@callstack/reassure-measure@0.6.0":
version "0.6.0"
resolved "https://registry.yarnpkg.com/@callstack/reassure-measure/-/reassure-measure-0.6.0.tgz#9c33260ab0148b8fdc077845a198bfa634f18bfc"
integrity sha512-phXY5DAtKhnu8dA2pmnl+pqFOfrVEFFDJOi4AnObwIcpDSn3IUXgNSe7rSi+JP/mXNWMLoUS8rnH4iIFDyf7qQ==
"@callstack/reassure-measure@1.0.0-beta":
version "1.0.0-beta"
resolved "https://registry.yarnpkg.com/@callstack/reassure-measure/-/reassure-measure-1.0.0-beta.tgz#b54ca299e325af89ebe972548c2e8cba77d2759d"
integrity sha512-hMnIqk5ZVMGUoCsW2MWQFLLkRDEc9lv8p0YVy6SZVakh+ivUXVz77hv9OkqQzm1CLrg0OmjfJkk34+0zsdATeA==
dependencies:
"@callstack/reassure-logger" "0.3.1"
"@callstack/reassure-logger" "1.0.0-beta"
mathjs "^11.5.0"

"@expo/[email protected]", "@expo/bunyan@^4.0.0":
Expand All @@ -1226,10 +1226,10 @@
mv "~2"
safe-json-stringify "~1"

"@expo/[email protected].13":
version "0.10.13"
resolved "https://registry.yarnpkg.com/@expo/cli/-/cli-0.10.13.tgz#6503e6c477a8407986cd645952b0ad6177e08fe7"
integrity sha512-8ciyz+yIDih6zCNMWK0IyEv411W7vej/TaWIFGarogPVbFokXrUKr0aKoQG1RU1SLlY4eUpHakbIzqog+rhJdQ==
"@expo/[email protected].16":
version "0.10.16"
resolved "https://registry.yarnpkg.com/@expo/cli/-/cli-0.10.16.tgz#42f9aaf08884f70f3a671b7d6b4f138ad39192d7"
integrity sha512-EwgnRN5AMElg0JJjFLJTPk5hYkVXxnNMLIvZBiTfGoCq+rDw6u7Mg5l2Bbm/geSHOoplaHyPZ/Wr23FAuZWehA==
dependencies:
"@babel/runtime" "^7.20.0"
"@expo/code-signing-certificates" "0.0.5"
Expand Down Expand Up @@ -2141,13 +2141,13 @@
dependencies:
"@sinonjs/commons" "^3.0.0"

"@testing-library/react-native@^12.3.0":
version "12.3.0"
resolved "https://registry.yarnpkg.com/@testing-library/react-native/-/react-native-12.3.0.tgz#ebf04dddb7e1c34c869b97b187ecd061211c9466"
integrity sha512-E2Prl8D/ey9sRgzLyfCPPmqvsevJW5tVUy4E/pBbO7nOP6OzI/jn2P3vctn/kFdkPY2aE/udlU5ZeNAben9U2A==
"@testing-library/react-native@^12.4.3":
version "12.4.3"
resolved "https://registry.yarnpkg.com/@testing-library/react-native/-/react-native-12.4.3.tgz#57cd6a88b289f19144558b5e97336b57101af3ec"
integrity sha512-WLE7VbbR5jZJQl3vfNK7Wt+IHnzhOxyu95Mr56EHmzH3XhC8DkrPVAnUq9asq/QWj4aGnymbinFx6zZys/WZmA==
dependencies:
jest-matcher-utils "^29.6.2"
pretty-format "^29.6.2"
jest-matcher-utils "^29.7.0"
pretty-format "^29.7.0"
redent "^3.0.0"

"@types/babel__core@^7.1.14":
Expand Down Expand Up @@ -3541,13 +3541,20 @@ expo-constants@~14.4.2:
"@expo/config" "~8.1.0"
uuid "^3.3.2"

expo-file-system@~15.4.0, expo-file-system@~15.4.4:
expo-file-system@~15.4.0:
version "15.4.4"
resolved "https://registry.yarnpkg.com/expo-file-system/-/expo-file-system-15.4.4.tgz#b29e0507b57ee0cc7173cf8844aaf992e411f518"
integrity sha512-F0xS88D85F7qVQ61r0qBnzh6VW/s6iIl+VaQEEi2nAIOQHw1JIEj4yCXPLTtbyn5VmArbe2dSL3KYz1V+BLkKA==
dependencies:
uuid "^3.4.0"

expo-file-system@~15.4.5:
version "15.4.5"
resolved "https://registry.yarnpkg.com/expo-file-system/-/expo-file-system-15.4.5.tgz#3ef68583027ff0e2fb9eca7a22b3caff6cfc550d"
integrity sha512-xy61KaTaDgXhT/dllwYDHm3ch026EyO8j4eC6wSVr/yE12MMMxAC09yGwy4f7kkOs6ztGVQF5j7ldRzNLN4l0Q==
dependencies:
uuid "^3.4.0"

expo-font@~11.4.0:
version "11.4.0"
resolved "https://registry.yarnpkg.com/expo-font/-/expo-font-11.4.0.tgz#e2d31c0bb76ba3c37c2d84703a49aeafc3afef28"
Expand All @@ -3572,38 +3579,38 @@ [email protected]:
find-up "^5.0.0"
fs-extra "^9.1.0"

[email protected].11:
version "1.5.11"
resolved "https://registry.yarnpkg.com/expo-modules-core/-/expo-modules-core-1.5.11.tgz#6ee33641cec5ef9c629393a267cef122110d2bf0"
integrity sha512-1Dj2t74nVjxq6xEQf2b9WFfAMhPzVnR0thY0PfRFgob4STyj3sq1U4PIHVWvKQBtDKIa227DrNRb+Hu+LqKWQg==
[email protected].12:
version "1.5.12"
resolved "https://registry.yarnpkg.com/expo-modules-core/-/expo-modules-core-1.5.12.tgz#07eb4de4bf25a3ec3e1924403e73d13c656613fd"
integrity sha512-mY4wTDU458dhwk7IVxLNkePlYXjs9BTgk4NQHBUXf0LapXsvr+i711qPZaFNO4egf5qq6fQV+Yfd/KUguHstnQ==
dependencies:
compare-versions "^3.4.0"
invariant "^2.2.4"

expo-status-bar@~1.6.0:
version "1.6.0"
resolved "https://registry.yarnpkg.com/expo-status-bar/-/expo-status-bar-1.6.0.tgz#e79ffdb9a84d2e0ec9a0dc7392d9ab364fefa9cf"
integrity sha512-e//Oi2WPdomMlMDD3skE4+1ZarKCJ/suvcB4Jo/nO427niKug5oppcPNYO+csR6y3ZglGuypS+3pp/hJ+Xp6fQ==
expo-status-bar@~1.7.1:
version "1.7.1"
resolved "https://registry.yarnpkg.com/expo-status-bar/-/expo-status-bar-1.7.1.tgz#f2772a529187282eaa0741279ed8d525bdce54c4"
integrity sha512-Wkm9uCmuQQBSU+l/AekWAQ1d0FYw560yL116+OAKJDyKBOUpPURoWkFbabM1EDxv+5scTuSThr/CvsA0nsSCow==

expo@~49.0.13:
version "49.0.13"
resolved "https://registry.yarnpkg.com/expo/-/expo-49.0.13.tgz#9ee185d4eb1ac2859e67895bd919db5a04d1b8ec"
integrity sha512-k2QFmT5XN490ksjKJgogfS5SFj6ZKCu1GwWz4VUV4S9gkPjzr8zQAZoVPKaWxUYRb6xDpTJXdhLt7gSnV3bJvw==
expo@^49.0.21:
version "49.0.21"
resolved "https://registry.yarnpkg.com/expo/-/expo-49.0.21.tgz#32a66b32d0a233879ec3afdec35fb63d2cc8a4c3"
integrity sha512-JpHL6V0yt8/fzsmkAdPdtsah+lU6Si4ac7MDklLYvzEil7HAFEsN/pf06wQ21ax4C+BL27hI6JJoD34tzXUCJA==
dependencies:
"@babel/runtime" "^7.20.0"
"@expo/cli" "0.10.13"
"@expo/cli" "0.10.16"
"@expo/config" "8.1.2"
"@expo/config-plugins" "7.2.5"
"@expo/vector-icons" "^13.0.0"
babel-preset-expo "~9.5.2"
expo-application "~5.3.0"
expo-asset "~8.10.1"
expo-constants "~14.4.2"
expo-file-system "~15.4.4"
expo-file-system "~15.4.5"
expo-font "~11.4.0"
expo-keep-awake "~12.3.0"
expo-modules-autolinking "1.5.1"
expo-modules-core "1.5.11"
expo-modules-core "1.5.12"
fbemitter "^3.0.0"
invariant "^2.2.4"
md5-file "^3.2.3"
Expand Down Expand Up @@ -4549,7 +4556,7 @@ jest-leak-detector@^29.7.0:
jest-get-type "^29.6.3"
pretty-format "^29.7.0"

jest-matcher-utils@^29.6.2, jest-matcher-utils@^29.7.0:
jest-matcher-utils@^29.7.0:
version "29.7.0"
resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.7.0.tgz#ae8fec79ff249fd592ce80e3ee474e83a6c44f12"
integrity sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g==
Expand Down Expand Up @@ -6059,7 +6066,7 @@ pretty-format@^26.5.2, pretty-format@^26.6.2:
ansi-styles "^4.0.0"
react-is "^17.0.1"

pretty-format@^29.0.0, pretty-format@^29.6.2, pretty-format@^29.7.0:
pretty-format@^29.0.0, pretty-format@^29.7.0:
version "29.7.0"
resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.7.0.tgz#ca42c758310f365bfa71a0bda0a807160b776812"
integrity sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==
Expand Down Expand Up @@ -6204,10 +6211,10 @@ react-is@^17.0.1:
resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.2.tgz#e691d4a8e9c789365655539ab372762b0efb54f0"
integrity sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==

[email protected].5:
version "0.72.5"
resolved "https://registry.yarnpkg.com/react-native/-/react-native-0.72.5.tgz#2c343fa6f3ead362cf07376634a33a4078864357"
integrity sha512-oIewslu5DBwOmo7x5rdzZlZXCqDIna0R4dUwVpfmVteORYLr4yaZo5wQnMeR+H7x54GaMhmgeqp0ZpULtulJFg==
[email protected].6:
version "0.72.6"
resolved "https://registry.yarnpkg.com/react-native/-/react-native-0.72.6.tgz#9f8d090694907e2f83af22e115cc0e4a3d5fa626"
integrity sha512-RafPY2gM7mcrFySS8TL8x+TIO3q7oAlHpzEmC7Im6pmXni6n1AuufGaVh0Narbr1daxstw7yW7T9BKW5dpVc2A==
dependencies:
"@jest/create-cache-key-function" "^29.2.1"
"@react-native-community/cli" "11.3.7"
Expand Down Expand Up @@ -6311,14 +6318,14 @@ readline@^1.3.0:
resolved "https://registry.yarnpkg.com/readline/-/readline-1.3.0.tgz#c580d77ef2cfc8752b132498060dc9793a7ac01c"
integrity sha512-k2d6ACCkiNYz222Fs/iNze30rRJ1iIicW7JuX/7/cozvih6YCkFZH+J6mAFDVgv0dRBaAyr4jDqC95R2y4IADg==

reassure@^0.10.0:
version "0.10.0"
resolved "https://registry.yarnpkg.com/reassure/-/reassure-0.10.0.tgz#ba733f45d9a8dd888428c25965a1657011665ef5"
integrity sha512-dhJM6Eq7Dt4ojY3HjyeFCvuOlEQMsE9m4E7hN9Sl/Flh7FWaxj2YfXXVbap5DhuNZgmv4CnDX0jfSW6nkZQjjA==
reassure@^1.0.0-beta:
version "1.0.0-beta"
resolved "https://registry.yarnpkg.com/reassure/-/reassure-1.0.0-beta.tgz#ec53c2b1a7aeef24f6a01119c199962f5ec02740"
integrity sha512-L1KKbN0Q/M7eIaCAj8aVhVsXjJugIbewpKaiogW8f3leNICArN5/392ZCKmwQY4js2huD96MQ8/p4i5howjayA==
dependencies:
"@callstack/reassure-cli" "0.10.0"
"@callstack/reassure-danger" "0.1.1"
"@callstack/reassure-measure" "0.6.0"
"@callstack/reassure-cli" "1.0.0-beta"
"@callstack/reassure-danger" "1.0.0-beta"
"@callstack/reassure-measure" "1.0.0-beta"

recast@^0.21.0:
version "0.21.5"
Expand Down
2 changes: 2 additions & 0 deletions examples/native/.bundle/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
BUNDLE_PATH: "vendor/bundle"
BUNDLE_FORCE_RUBY_PLATFORM: 1
11 changes: 1 addition & 10 deletions examples/native/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
module.exports = {
root: true,
extends: '@callstack/eslint-config',
rules: {
// typescript will handle that
'import/no-extraneous-dependencies': 'off',
'import/no-unresolved': 'off',
'jest/expect-expect': [
'error',
{ assertFunctionNames: ['expect', 'measurePerformance'] },
],
},
extends: '@react-native',
};
6 changes: 5 additions & 1 deletion examples/native/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,9 @@ yarn-error.log

# Temporary files created by Metro to check the health of the file watcher
.metro-health-check*

# testing
/coverage

# Reassure output directory
.reassure
.reassure
Loading

0 comments on commit a9e0aad

Please sign in to comment.