mirror of
https://github.com/callstack/react-native-testing-library.git
synced 2026-09-18 23:09:04 +08:00
feat: add rerender as an alias for update (#149)
<!-- Please provide enough information so that others can review your pull request. --> <!-- Keep pull requests small and focused on a single change. --> ### Summary Users of `react-testing-library` use `rerender` wording instead of `update`. Let's make it easier for them by aliasing it. See: https://testing-library.com/docs/react-testing-library/api#rerender ### Test plan Added cases for JS tests and TS typings
This commit is contained in:
committed by
Kacper Wiszczuk
parent
488a2ca5cc
commit
439db6c823
@@ -99,6 +99,7 @@ const debugFn = tree.debug();
|
||||
const debugFnWithMessage = tree.debug('my message');
|
||||
|
||||
tree.update(<View />);
|
||||
tree.rerender(<View />);
|
||||
tree.unmount();
|
||||
|
||||
// fireEvent API tests
|
||||
|
||||
Vendored
+1
@@ -43,6 +43,7 @@ export interface RenderOptions {
|
||||
|
||||
export interface RenderAPI extends GetByAPI, QueryByAPI {
|
||||
update(nextElement: React.ReactElement<any>): void;
|
||||
rerender(nextElement: React.ReactElement<any>): void;
|
||||
unmount(nextElement?: React.ReactElement<any>): void;
|
||||
toJSON(): ReactTestRendererJSON | null;
|
||||
debug(message?: string): void;
|
||||
|
||||
Reference in New Issue
Block a user