mirror of
https://github.com/callstack/react-native-testing-library.git
synced 2026-09-18 23:09:04 +08:00
29 lines
661 B
TypeScript
29 lines
661 B
TypeScript
import { render } from '@testing-library/react-native';
|
|
|
|
// Function declaration
|
|
function renderWithProviders(component: React.ReactElement) {
|
|
render(component);
|
|
}
|
|
|
|
// Arrow function
|
|
const renderWithTheme = (component: React.ReactElement) => {
|
|
render(component);
|
|
};
|
|
|
|
// Function expression
|
|
const renderCustom = function (component: React.ReactElement) {
|
|
render(component);
|
|
};
|
|
|
|
test('uses custom render function declaration', () => {
|
|
renderWithProviders(<Component />);
|
|
});
|
|
|
|
test('uses custom render arrow function', () => {
|
|
renderWithTheme(<Component />);
|
|
});
|
|
|
|
test('uses custom render function expression', () => {
|
|
renderCustom(<Component />);
|
|
});
|