- Purpose: Measure React Native component render performance locally and detect regressions between a baseline and current code.
- Reassure CLI integrated.
- Coverage gating:
REASSURE=truedisables Jest coverage for perf runs. - Scripts:
yarn test:reassure:baseline→ writes.reassure/baseline.perfyarn test:reassure:branch→ writes.reassure/current.perf, compares, and exits non‑zero on significant regressions
- Examples:
app/component-library/components/Cards/Card/Card.perf-test.tsxapp/components/UI/DeepLinkModal/DeepLinkModal.perf-test.tsx(wrapped in Redux, Navigation, Safe Area providers)
- Baseline (current code):
yarn test:reassure:baseline- Make a change you want to measure (e.g., increase re-renders in a test)
- Compare:
yarn test:reassure:branch- Inspect results:
- Markdown:
.reassure/output.md - JSON:
.reassure/output.json
If regressions are detected, test:reassure:branch exits non‑zero.
- Basic mount-only measurement:
import { measureRenders } from 'reassure';
import Component from './Component';
test('mount performance', async () => {
await measureRenders(<Component />);
});- Writing async tests
import { measureRenders } from 'reassure';
import { fireEvent } from '@testing-library/react-native';
test('Test with scenario', async () => {
const scenario = async (screen) => {
fireEvent.press(screen.getByText('Go'));
await screen.findByText('Done');
};
await measureRenders(<ComponentUnderTest />, { scenario });
});- Once we establish enough perf tests, integrate CI to compare PR branches with stable branch.
- Establish stable branch baseline (e.g.,
stable):- On CI, checkout
origin/stable→yarn reassure --baseline(oryarn test:reassure:baseline). - Checkout the PR commit →
yarn reassure --branch(oryarn test:reassure:branch).
- On CI, checkout
- Report results in PR:
- Parse
.reassure/output.mdand post as a PR comment (Danger plugin is supported by Reassure). - Fail the job when
.reassure/output.json.significant.length > 0(we already use this exit‑gate locally intest:reassure:branch).
- Parse
- CI stability:
- Run
yarn reassure check-stabilityperiodically to validate agent noise. - Optionally increase
runsfor noisy agents.
- Run
- Caching (optional):
- Persist
.reassure/baseline.perfbetween pipeline steps when comparing within a single job matrix.
- Persist
This lets us keep local workflows simple, while paving the way for automated, repeatable perf regression checks on PRs against a stable baseline.