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:
Maciej Jastrzebski
2020-05-18 16:19:08 +02:00
committed by Michał Pierzchała
parent b3e5ca386c
commit 043f51d36c
8 changed files with 5 additions and 272 deletions
-12
View File
@@ -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')
);
-14
View File
@@ -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;