Skip to content

Commit 6248939

Browse files
chore: reassure 1.5.x (#122)
1 parent 2248e87 commit 6248939

18 files changed

Lines changed: 629 additions & 471 deletions

AGENTS.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ Active code lives under `examples/`. Run installs, tests, typechecks, builds, an
88

99
Non-standard validation to remember: `yarn perf-test` runs Reassure performance tests in examples that define it.
1010

11+
React Native examples use `@testing-library/react-native`. Its APIs and testing conventions can differ from your training data.
12+
Before writing or changing RNTL tests, read the relevant guide in
13+
`node_modules/@testing-library/react-native/docs/`, starting with
14+
`node_modules/@testing-library/react-native/docs/guides/llm-guidelines.md`.
15+
Prefer those package docs over stale assumptions, and follow deprecation notices.
16+
1117
See the focused guides before making task-specific changes:
1218

1319
- [Project Structure](docs/agents/project-structure.md)

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
For this repository, use AGENTS.md as the canonical agent guide. Read AGENTS.md first for compatibility.
1+
@AGENTS.md
Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
1-
/**
2-
* @format
3-
*/
4-
5-
import React from 'react';
6-
import ReactTestRenderer from 'react-test-renderer';
1+
import {render} from '@testing-library/react-native';
72
import App from '../App';
83

94
test('renders correctly', async () => {
10-
await ReactTestRenderer.act(() => {
11-
ReactTestRenderer.create(<App />);
12-
});
5+
await render(<App />);
136
});

examples/native-cli/package.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,19 @@
2626
"@react-native/eslint-config": "0.79.2",
2727
"@react-native/metro-config": "0.79.2",
2828
"@react-native/typescript-config": "0.79.2",
29-
"@testing-library/react-native": "^13.2.0",
29+
"@testing-library/react-native": "^14.0.0",
3030
"@types/jest": "^30.0.0",
3131
"@types/react": "^19.0.0",
32-
"@types/react-test-renderer": "^19.0.0",
3332
"danger": "^13.0.4",
3433
"eslint": "^8.19.0",
3534
"jest": "^30.0.2",
3635
"prettier": "2.8.8",
37-
"react-test-renderer": "19.0.0",
38-
"reassure": "^1.4.0",
36+
"reassure": "^1.5.1",
37+
"test-renderer": "1.0.0",
3938
"typescript": "5.0.4"
4039
},
4140
"engines": {
42-
"node": ">=18"
41+
"node": "^22.13.0 || >=24"
4342
},
4443
"packageManager": "yarn@4.9.2"
4544
}

examples/native-cli/src/AsyncComponent.perf.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import React from 'react';
21
import {jest, test} from '@jest/globals';
32
import {fireEvent, screen} from '@testing-library/react-native';
43
import {measureRenders} from 'reassure';
@@ -10,8 +9,8 @@ test('RN CLI - AsyncComponent (10 runs)', async () => {
109
const scenario = async () => {
1110
const button = screen.getByText('Action');
1211

13-
fireEvent.press(button);
14-
fireEvent.press(button);
12+
await fireEvent.press(button);
13+
await fireEvent.press(button);
1514
await screen.findByText('Count: 2');
1615
};
1716

@@ -22,8 +21,8 @@ test('RN CLI - AsyncComponent (50 runs)', async () => {
2221
const scenario = async () => {
2322
const button = screen.getByText('Action');
2423

25-
fireEvent.press(button);
26-
fireEvent.press(button);
24+
await fireEvent.press(button);
25+
await fireEvent.press(button);
2726
await screen.findByText('Count: 2');
2827
};
2928

examples/native-cli/src/TestList.perf.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import * as React from 'react';
21
import {jest, test} from '@jest/globals';
32
import {measureRenders} from 'reassure';
43
import {TestList} from './TestList';

examples/native-cli/src/TestList.test.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
import * as React from 'react';
21
import {render, screen} from '@testing-library/react-native';
32
import {expect, test} from '@jest/globals';
43
import {TestList} from './TestList';
54

6-
test('TestList', () => {
7-
render(<TestList count={10} />);
5+
test('TestList', async () => {
6+
await render(<TestList count={10} />);
87

98
const items = screen.getAllByText(/Item/i);
109
expect(items).toHaveLength(10);

0 commit comments

Comments
 (0)