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