Skip to content

chore: update deps 2024-03-12 #1570

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,6 @@ jobs:
- name: Typecheck
run: yarn typecheck

flow:
needs: [install-cache-deps]
runs-on: ubuntu-latest
name: Flow
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js and deps
uses: ./.github/actions/setup-deps

- name: Flow
run: yarn flow

test:
needs: [install-cache-deps]
runs-on: ubuntu-latest
Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ test('form submits two answers', async () => {
await user.press(screen.getByRole('button', { name: 'Submit' }));

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

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


## Made with ❤️ at Callstack

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!
Expand Down
2 changes: 1 addition & 1 deletion examples/basic/components/LoginForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ async function authUser(username: string, password: string): Promise<string | nu
setTimeout(() => {
const hasValidCredentials = username === 'admin' && password === 'admin1';
resolve(hasValidCredentials ? username : null);
}, 250)
}, 250),
);
}

Expand Down
2 changes: 1 addition & 1 deletion examples/redux/components/AddTodo.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ test('adds a new todo to redux store when submitting form', () => {
text: textToEnter,
date: expect.any(Date),
}),
])
]),
);
});
26 changes: 12 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,35 +69,33 @@
}
},
"devDependencies": {
"@babel/cli": "^7.23.4",
"@babel/core": "^7.23.3",
"@babel/cli": "^7.23.9",
"@babel/core": "^7.24.0",
"@babel/plugin-transform-flow-strip-types": "^7.23.3",
"@babel/preset-env": "^7.23.3",
"@babel/preset-flow": "^7.23.3",
"@babel/preset-env": "^7.24.0",
"@babel/preset-flow": "^7.24.0",
"@babel/preset-react": "^7.23.3",
"@babel/preset-typescript": "^7.23.3",
"@callstack/eslint-config": "^14.1.0",
"@release-it/conventional-changelog": "^8.0.1",
"@relmify/jest-serializer-strip-ansi": "^1.0.2",
"@types/jest": "^29.5.10",
"@types/react": "^18.2.38",
"@types/jest": "^29.5.12",
"@types/react": "^18.2.65",
"@types/react-test-renderer": "^18.0.7",
"babel-jest": "^29.7.0",
"dedent": "^1.5.1",
"del-cli": "^5.1.0",
"eslint": "^8.54.0",
"eslint": "^8.57.0",
"eslint-plugin-flowtype": "^8.0.3",
"eslint-plugin-prettier": "^5.1.2",
"eslint-plugin-prettier": "^4.2.1",
"flow-bin": "~0.170.0",
"flow-copy-source": "^2.0.9",
"jest": "^29.7.0",
"prettier": "^3.1.1",
"prettier": "^2.8.8",
"react": "18.2.0",
"react-native": "0.72.7",
"react-native": "0.73.6",
"react-test-renderer": "18.2.0",
"release-it": "^17.0.1",
"release-it": "^17.1.1",
"strip-ansi": "^6.0.1",
"typescript": "^5.3.2"
"typescript": "^5.4.2"
},
"publishConfig": {
"registry": "https://registry.npmjs.org"
Expand Down
2 changes: 1 addition & 1 deletion .prettierrc.js → prettier.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// added for Jest inline snapshots to not use default Prettier config
module.exports = {
singleQuote: true,
trailingComma: 'es5',
trailingComma: 'all',
};
8 changes: 4 additions & 4 deletions src/__tests__/fire-event-textInput.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ test('should fire only non-touch-related events on non-editable TextInput', () =
onChangeText={onChangeText}
onSubmitEditing={onSubmitEditing}
onLayout={onLayout}
/>
/>,
);

const subject = screen.getByTestId('subject');
Expand Down Expand Up @@ -57,7 +57,7 @@ test('should fire only non-touch-related events on non-editable TextInput with n
onLayout={onLayout}
>
<Text>Nested Text</Text>
</TextInput>
</TextInput>,
);

const subject = screen.getByText('Nested Text');
Expand Down Expand Up @@ -106,7 +106,7 @@ test('should fire only non-touch-related events on non-editable wrapped TextInpu
onChangeText={onChangeText}
onSubmitEditing={onSubmitEditing}
onLayout={onLayout}
/>
/>,
);

const subject = screen.getByTestId('subject');
Expand Down Expand Up @@ -138,7 +138,7 @@ test('should fire only non-touch-related events on non-editable double wrapped T
onChangeText={onChangeText}
onSubmitEditing={onSubmitEditing}
onLayout={onLayout}
/>
/>,
);

const subject = screen.getByTestId('subject');
Expand Down
28 changes: 14 additions & 14 deletions src/__tests__/fire-event.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ describe('fireEvent', () => {
const onPressMock = jest.fn();
render(
// TODO: this functionality is buggy, i.e. it will fail if we wrap this component with a View.
<WithoutEventComponent onPress={onPressMock} />
<WithoutEventComponent onPress={onPressMock} />,
);
fireEvent(screen.getByText('Without event'), 'press');
expect(onPressMock).not.toHaveBeenCalled();
Expand All @@ -91,7 +91,7 @@ describe('fireEvent', () => {
render(
<View>
<CustomEventComponent onCustomEvent={handlerMock} />
</View>
</View>,
);

fireEvent(screen.getByText('Custom event component'), 'customEvent', EVENT_DATA);
Expand Down Expand Up @@ -129,7 +129,7 @@ test('fireEvent.scroll', () => {
render(
<ScrollView onScroll={onScrollMock}>
<Text>XD</Text>
</ScrollView>
</ScrollView>,
);

fireEvent.scroll(screen.getByText('XD'), eventData);
Expand All @@ -144,7 +144,7 @@ test('fireEvent.changeText', () => {
render(
<View>
<TextInput placeholder="Customer placeholder" onChangeText={onChangeTextMock} />
</View>
</View>,
);

fireEvent.changeText(screen.getByPlaceholderText('Customer placeholder'), CHANGE_TEXT);
Expand Down Expand Up @@ -179,7 +179,7 @@ test('should not fire on disabled TouchableOpacity', () => {
<TouchableOpacity onPress={handlePress} disabled={true}>
<Text>Trigger</Text>
</TouchableOpacity>
</View>
</View>,
);

fireEvent.press(screen.getByText('Trigger'));
Expand All @@ -193,7 +193,7 @@ test('should not fire on disabled Pressable', () => {
<Pressable onPress={handlePress} disabled={true}>
<Text>Trigger</Text>
</Pressable>
</View>
</View>,
);

fireEvent.press(screen.getByText('Trigger'));
Expand All @@ -207,7 +207,7 @@ test('should not fire inside View with pointerEvents="none"', () => {
<Pressable onPress={onPress}>
<Text>Trigger</Text>
</Pressable>
</View>
</View>,
);

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

fireEvent.press(screen.getByText('Trigger'));
Expand All @@ -237,7 +237,7 @@ test('should fire inside View with pointerEvents="box-none"', () => {
<Pressable onPress={onPress}>
<Text>Trigger</Text>
</Pressable>
</View>
</View>,
);

fireEvent.press(screen.getByText('Trigger'));
Expand All @@ -252,7 +252,7 @@ test('should fire inside View with pointerEvents="auto"', () => {
<Pressable onPress={onPress}>
<Text>Trigger</Text>
</Pressable>
</View>
</View>,
);

fireEvent.press(screen.getByText('Trigger'));
Expand All @@ -269,7 +269,7 @@ test('should not fire deeply inside View with pointerEvents="box-only"', () => {
<Text>Trigger</Text>
</Pressable>
</View>
</View>
</View>,
);

fireEvent.press(screen.getByText('Trigger'));
Expand Down Expand Up @@ -311,7 +311,7 @@ test('should pass event up on disabled TouchableOpacity', () => {
<TouchableOpacity onPress={handleInnerPress} disabled={true}>
<Text>Inner Trigger</Text>
</TouchableOpacity>
</TouchableOpacity>
</TouchableOpacity>,
);

fireEvent.press(screen.getByText('Inner Trigger'));
Expand All @@ -327,7 +327,7 @@ test('should pass event up on disabled Pressable', () => {
<Pressable onPress={handleInnerPress} disabled={true}>
<Text>Inner Trigger</Text>
</Pressable>
</Pressable>
</Pressable>,
);

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

fireEvent.press(screen.getByText('Trigger'));
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/host-component-names.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ describe('getHostComponentNames', () => {
expect(() =>
act(() => {
getHostComponentNames();
})
}),
).not.toThrow();
});
});
Expand Down
10 changes: 5 additions & 5 deletions src/__tests__/host-text-nesting.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe('nested text handling', () => {
<Text testID="child" accessibilityRole="header">
About
</Text>
</Text>
</Text>,
);

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

expect(screen.getByRole('button', { name: 'Save' }).props.testID).toBe('pressable');
Expand All @@ -54,7 +54,7 @@ describe('nested text handling', () => {
<Text>Save</Text>
</View>
</Pressable>
</View>
</View>,
);

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

expect(screen.getByText('Save').props.testID).toBe('text');
Expand All @@ -76,7 +76,7 @@ describe('nested text handling', () => {
<View>
<Text testID="text">Save</Text>
</View>
</Pressable>
</Pressable>,
);

expect(screen.getByText('Save').props.testID).toBe('text');
Expand Down
Loading