mirror of
https://github.com/callstack/react-native-testing-library.git
synced 2026-09-18 23:09:04 +08:00
feat(breaking): remove legacy debug export (#328)
* Removed global `debug` functions * Removed global `debug` from docs * Cleanup * Added migration section Co-authored-by: Michał Pierzchała <thymikee@gmail.com>
This commit is contained in:
committed by
Michał Pierzchała
parent
b3e5ca386c
commit
043f51d36c
@@ -6,7 +6,6 @@ import {
|
||||
fireEvent,
|
||||
shallow,
|
||||
flushMicrotasksQueue,
|
||||
debug,
|
||||
waitForElement,
|
||||
act,
|
||||
within,
|
||||
@@ -251,17 +250,6 @@ const shallowTree: { output: React.ReactElement<any> } = shallow(
|
||||
|
||||
const waitForFlush: Promise<any> = flushMicrotasksQueue();
|
||||
|
||||
// debug API
|
||||
debug(<TestComponent />);
|
||||
debug(<TestComponent />, 'message');
|
||||
debug(getByNameString);
|
||||
debug(getByNameString, 'message');
|
||||
debug.shallow(<TestComponent />);
|
||||
debug.shallow(<TestComponent />, 'message');
|
||||
debug.deep(<TestComponent />);
|
||||
debug.deep(<TestComponent />, 'message');
|
||||
debug.deep(tree.toJSON());
|
||||
|
||||
const waitBy: Promise<ReactTestInstance> = waitForElement<ReactTestInstance>(
|
||||
() => tree.getByName('View')
|
||||
);
|
||||
|
||||
Vendored
-14
@@ -230,19 +230,6 @@ export type WaitForElementFunction = <T = any>(
|
||||
interval?: number
|
||||
) => Promise<T>;
|
||||
|
||||
export type DebugFunction = (
|
||||
instance: ReactTestInstance | React.ReactElement<any>,
|
||||
message?: string
|
||||
) => void;
|
||||
|
||||
export type DebugAPI = DebugFunction & {
|
||||
shallow: DebugFunction;
|
||||
deep: (
|
||||
instance: React.ReactElement<any> | ReactTestRendererJSON | null,
|
||||
message?: string
|
||||
) => void;
|
||||
};
|
||||
|
||||
export declare const render: (
|
||||
component: React.ReactElement<any>,
|
||||
options?: RenderOptions
|
||||
@@ -252,7 +239,6 @@ export declare const shallow: <P = {}>(
|
||||
) => { output: React.ReactElement<P> };
|
||||
export declare const flushMicrotasksQueue: () => Promise<any>;
|
||||
export declare const cleanup: () => void;
|
||||
export declare const debug: DebugAPI;
|
||||
export declare const fireEvent: FireEventAPI;
|
||||
export declare const waitForElement: WaitForElementFunction;
|
||||
export declare const act: (callback: () => void) => Thenable;
|
||||
|
||||
Reference in New Issue
Block a user