Skip to content

Commit bab4097

Browse files
chore: update deps 2024-03-12 (#1570)
* chore: update 1 * chore: update @types/* * chore: update react native * chore: update eslint & typescript * chore: fix lint * chore: upgrade release it * chore: reformat * chore: disable flow validation
1 parent 4e148bd commit bab4097

File tree

125 files changed

+1823
-1479
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+1823
-1479
lines changed

.github/workflows/main.yml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -44,20 +44,6 @@ jobs:
4444
- name: Typecheck
4545
run: yarn typecheck
4646

47-
flow:
48-
needs: [install-cache-deps]
49-
runs-on: ubuntu-latest
50-
name: Flow
51-
steps:
52-
- name: Checkout
53-
uses: actions/checkout@v4
54-
55-
- name: Setup Node.js and deps
56-
uses: ./.github/actions/setup-deps
57-
58-
- name: Flow
59-
run: yarn flow
60-
6147
test:
6248
needs: [install-cache-deps]
6349
runs-on: ubuntu-latest

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ test('form submits two answers', async () => {
109109
await user.press(screen.getByRole('button', { name: 'Submit' }));
110110

111111
expect(onSubmit).toHaveBeenCalledWith({
112-
'1': { q: 'q1', a: 'a1' },
113-
'2': { q: 'q2', a: 'a2' },
112+
1: { q: 'q1', a: 'a1' },
113+
2: { q: 'q2', a: 'a2' },
114114
});
115115
});
116116
```
@@ -143,7 +143,6 @@ The [public API](https://callstack.github.io/react-native-testing-library/docs/a
143143

144144
Check out our list of [Community Resources about RNTL](https://callstack.github.io/react-native-testing-library/docs/community-resources).
145145

146-
147146
## Made with ❤️ at Callstack
148147

149148
React Native Testing Library is an open source project and will always remain free to use. If you think it's cool, please star it 🌟. [Callstack](https://callstack.com) is a group of React and React Native geeks, contact us at [[email protected]](mailto:[email protected]) if you need any help with these or just want to say hi!

examples/basic/components/LoginForm.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ async function authUser(username: string, password: string): Promise<string | nu
8282
setTimeout(() => {
8383
const hasValidCredentials = username === 'admin' && password === 'admin1';
8484
resolve(hasValidCredentials ? username : null);
85-
}, 250)
85+
}, 250),
8686
);
8787
}
8888

examples/redux/components/AddTodo.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ test('adds a new todo to redux store when submitting form', () => {
2222
text: textToEnter,
2323
date: expect.any(Date),
2424
}),
25-
])
25+
]),
2626
);
2727
});

package.json

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -69,35 +69,33 @@
6969
}
7070
},
7171
"devDependencies": {
72-
"@babel/cli": "^7.23.4",
73-
"@babel/core": "^7.23.3",
72+
"@babel/cli": "^7.23.9",
73+
"@babel/core": "^7.24.0",
7474
"@babel/plugin-transform-flow-strip-types": "^7.23.3",
75-
"@babel/preset-env": "^7.23.3",
76-
"@babel/preset-flow": "^7.23.3",
75+
"@babel/preset-env": "^7.24.0",
76+
"@babel/preset-flow": "^7.24.0",
7777
"@babel/preset-react": "^7.23.3",
7878
"@babel/preset-typescript": "^7.23.3",
7979
"@callstack/eslint-config": "^14.1.0",
8080
"@release-it/conventional-changelog": "^8.0.1",
8181
"@relmify/jest-serializer-strip-ansi": "^1.0.2",
82-
"@types/jest": "^29.5.10",
83-
"@types/react": "^18.2.38",
82+
"@types/jest": "^29.5.12",
83+
"@types/react": "^18.2.65",
8484
"@types/react-test-renderer": "^18.0.7",
8585
"babel-jest": "^29.7.0",
86-
"dedent": "^1.5.1",
8786
"del-cli": "^5.1.0",
88-
"eslint": "^8.54.0",
87+
"eslint": "^8.57.0",
8988
"eslint-plugin-flowtype": "^8.0.3",
90-
"eslint-plugin-prettier": "^5.1.2",
89+
"eslint-plugin-prettier": "^4.2.1",
9190
"flow-bin": "~0.170.0",
92-
"flow-copy-source": "^2.0.9",
9391
"jest": "^29.7.0",
94-
"prettier": "^3.1.1",
92+
"prettier": "^2.8.8",
9593
"react": "18.2.0",
96-
"react-native": "0.72.7",
94+
"react-native": "0.73.6",
9795
"react-test-renderer": "18.2.0",
98-
"release-it": "^17.0.1",
96+
"release-it": "^17.1.1",
9997
"strip-ansi": "^6.0.1",
100-
"typescript": "^5.3.2"
98+
"typescript": "^5.4.2"
10199
},
102100
"publishConfig": {
103101
"registry": "https://registry.npmjs.org"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// added for Jest inline snapshots to not use default Prettier config
22
module.exports = {
33
singleQuote: true,
4-
trailingComma: 'es5',
4+
trailingComma: 'all',
55
};

src/__tests__/fire-event-textInput.test.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ test('should fire only non-touch-related events on non-editable TextInput', () =
2626
onChangeText={onChangeText}
2727
onSubmitEditing={onSubmitEditing}
2828
onLayout={onLayout}
29-
/>
29+
/>,
3030
);
3131

3232
const subject = screen.getByTestId('subject');
@@ -57,7 +57,7 @@ test('should fire only non-touch-related events on non-editable TextInput with n
5757
onLayout={onLayout}
5858
>
5959
<Text>Nested Text</Text>
60-
</TextInput>
60+
</TextInput>,
6161
);
6262

6363
const subject = screen.getByText('Nested Text');
@@ -106,7 +106,7 @@ test('should fire only non-touch-related events on non-editable wrapped TextInpu
106106
onChangeText={onChangeText}
107107
onSubmitEditing={onSubmitEditing}
108108
onLayout={onLayout}
109-
/>
109+
/>,
110110
);
111111

112112
const subject = screen.getByTestId('subject');
@@ -138,7 +138,7 @@ test('should fire only non-touch-related events on non-editable double wrapped T
138138
onChangeText={onChangeText}
139139
onSubmitEditing={onSubmitEditing}
140140
onLayout={onLayout}
141-
/>
141+
/>,
142142
);
143143

144144
const subject = screen.getByTestId('subject');

src/__tests__/fire-event.test.tsx

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ describe('fireEvent', () => {
7878
const onPressMock = jest.fn();
7979
render(
8080
// TODO: this functionality is buggy, i.e. it will fail if we wrap this component with a View.
81-
<WithoutEventComponent onPress={onPressMock} />
81+
<WithoutEventComponent onPress={onPressMock} />,
8282
);
8383
fireEvent(screen.getByText('Without event'), 'press');
8484
expect(onPressMock).not.toHaveBeenCalled();
@@ -91,7 +91,7 @@ describe('fireEvent', () => {
9191
render(
9292
<View>
9393
<CustomEventComponent onCustomEvent={handlerMock} />
94-
</View>
94+
</View>,
9595
);
9696

9797
fireEvent(screen.getByText('Custom event component'), 'customEvent', EVENT_DATA);
@@ -129,7 +129,7 @@ test('fireEvent.scroll', () => {
129129
render(
130130
<ScrollView onScroll={onScrollMock}>
131131
<Text>XD</Text>
132-
</ScrollView>
132+
</ScrollView>,
133133
);
134134

135135
fireEvent.scroll(screen.getByText('XD'), eventData);
@@ -144,7 +144,7 @@ test('fireEvent.changeText', () => {
144144
render(
145145
<View>
146146
<TextInput placeholder="Customer placeholder" onChangeText={onChangeTextMock} />
147-
</View>
147+
</View>,
148148
);
149149

150150
fireEvent.changeText(screen.getByPlaceholderText('Customer placeholder'), CHANGE_TEXT);
@@ -179,7 +179,7 @@ test('should not fire on disabled TouchableOpacity', () => {
179179
<TouchableOpacity onPress={handlePress} disabled={true}>
180180
<Text>Trigger</Text>
181181
</TouchableOpacity>
182-
</View>
182+
</View>,
183183
);
184184

185185
fireEvent.press(screen.getByText('Trigger'));
@@ -193,7 +193,7 @@ test('should not fire on disabled Pressable', () => {
193193
<Pressable onPress={handlePress} disabled={true}>
194194
<Text>Trigger</Text>
195195
</Pressable>
196-
</View>
196+
</View>,
197197
);
198198

199199
fireEvent.press(screen.getByText('Trigger'));
@@ -207,7 +207,7 @@ test('should not fire inside View with pointerEvents="none"', () => {
207207
<Pressable onPress={onPress}>
208208
<Text>Trigger</Text>
209209
</Pressable>
210-
</View>
210+
</View>,
211211
);
212212

213213
fireEvent.press(screen.getByText('Trigger'));
@@ -222,7 +222,7 @@ test('should not fire inside View with pointerEvents="box-only"', () => {
222222
<Pressable onPress={onPress}>
223223
<Text>Trigger</Text>
224224
</Pressable>
225-
</View>
225+
</View>,
226226
);
227227

228228
fireEvent.press(screen.getByText('Trigger'));
@@ -237,7 +237,7 @@ test('should fire inside View with pointerEvents="box-none"', () => {
237237
<Pressable onPress={onPress}>
238238
<Text>Trigger</Text>
239239
</Pressable>
240-
</View>
240+
</View>,
241241
);
242242

243243
fireEvent.press(screen.getByText('Trigger'));
@@ -252,7 +252,7 @@ test('should fire inside View with pointerEvents="auto"', () => {
252252
<Pressable onPress={onPress}>
253253
<Text>Trigger</Text>
254254
</Pressable>
255-
</View>
255+
</View>,
256256
);
257257

258258
fireEvent.press(screen.getByText('Trigger'));
@@ -269,7 +269,7 @@ test('should not fire deeply inside View with pointerEvents="box-only"', () => {
269269
<Text>Trigger</Text>
270270
</Pressable>
271271
</View>
272-
</View>
272+
</View>,
273273
);
274274

275275
fireEvent.press(screen.getByText('Trigger'));
@@ -311,7 +311,7 @@ test('should pass event up on disabled TouchableOpacity', () => {
311311
<TouchableOpacity onPress={handleInnerPress} disabled={true}>
312312
<Text>Inner Trigger</Text>
313313
</TouchableOpacity>
314-
</TouchableOpacity>
314+
</TouchableOpacity>,
315315
);
316316

317317
fireEvent.press(screen.getByText('Inner Trigger'));
@@ -327,7 +327,7 @@ test('should pass event up on disabled Pressable', () => {
327327
<Pressable onPress={handleInnerPress} disabled={true}>
328328
<Text>Inner Trigger</Text>
329329
</Pressable>
330-
</Pressable>
330+
</Pressable>,
331331
);
332332

333333
fireEvent.press(screen.getByText('Inner Trigger'));
@@ -376,7 +376,7 @@ test('is not fooled by non-responder wrapping host elements', () => {
376376
render(
377377
<View>
378378
<TestChildTouchableComponent onPress={handlePress} someProp={true} />
379-
</View>
379+
</View>,
380380
);
381381

382382
fireEvent.press(screen.getByText('Trigger'));

src/__tests__/host-component-names.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ describe('getHostComponentNames', () => {
5353
expect(() =>
5454
act(() => {
5555
getHostComponentNames();
56-
})
56+
}),
5757
).not.toThrow();
5858
});
5959
});

src/__tests__/host-text-nesting.test.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ describe('nested text handling', () => {
2828
<Text testID="child" accessibilityRole="header">
2929
About
3030
</Text>
31-
</Text>
31+
</Text>,
3232
);
3333

3434
expect(screen.getByRole('header', { name: 'About' }).props.testID).toBe('child');
@@ -40,7 +40,7 @@ describe('nested text handling', () => {
4040
<Pressable testID="pressable" accessibilityRole="button">
4141
<Text>Save</Text>
4242
</Pressable>
43-
</View>
43+
</View>,
4444
);
4545

4646
expect(screen.getByRole('button', { name: 'Save' }).props.testID).toBe('pressable');
@@ -54,7 +54,7 @@ describe('nested text handling', () => {
5454
<Text>Save</Text>
5555
</View>
5656
</Pressable>
57-
</View>
57+
</View>,
5858
);
5959

6060
expect(screen.getByRole('button', { name: 'Save' }).props.testID).toBe('pressable');
@@ -64,7 +64,7 @@ describe('nested text handling', () => {
6464
render(
6565
<Pressable testID="pressable" accessibilityRole="button">
6666
<Text testID="text">Save</Text>
67-
</Pressable>
67+
</Pressable>,
6868
);
6969

7070
expect(screen.getByText('Save').props.testID).toBe('text');
@@ -76,7 +76,7 @@ describe('nested text handling', () => {
7676
<View>
7777
<Text testID="text">Save</Text>
7878
</View>
79-
</Pressable>
79+
</Pressable>,
8080
);
8181

8282
expect(screen.getByText('Save').props.testID).toBe('text');

0 commit comments

Comments
 (0)