From b4584a24c729aee46388b8896f8a46d63ba5964a Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Tue, 23 Jul 2019 10:15:26 -0700 Subject: [PATCH] Prepare for TS #32460 (#37057) * Prepare for TS #32460 * Revert change --- types/react-dom/test-utils/index.d.ts | 5 ++--- types/react-test-renderer/index.d.ts | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/types/react-dom/test-utils/index.d.ts b/types/react-dom/test-utils/index.d.ts index ea61a9c858..23a10bc79d 100644 --- a/types/react-dom/test-utils/index.d.ts +++ b/types/react-dom/test-utils/index.d.ts @@ -291,9 +291,8 @@ export function createRenderer(): ShallowRenderer; * @see https://reactjs.org/blog/2019/02/06/react-v16.8.0.html#testing-hooks */ // the "void | undefined" is here to forbid any sneaky "Promise" returns. -// the actual return value is always a "DebugPromiseLike", -// but having an "| {}" makes it harder to accidentally use. -export function act(callback: () => void | undefined): DebugPromiseLike | {}; +// the actual return value is always a "DebugPromiseLike". +export function act(callback: () => void | undefined): DebugPromiseLike; // Intentionally doesn't extend PromiseLike. // Ideally this should be as hard to accidentally use as possible. diff --git a/types/react-test-renderer/index.d.ts b/types/react-test-renderer/index.d.ts index c5dccdbc0a..edc45d5f91 100644 --- a/types/react-test-renderer/index.d.ts +++ b/types/react-test-renderer/index.d.ts @@ -65,9 +65,8 @@ export function create(nextElement: ReactElement, options?: TestRendererOptions) * @see https://reactjs.org/blog/2019/02/06/react-v16.8.0.html#testing-hooks */ // the "void | undefined" is here to forbid any sneaky "Promise" returns. -// the actual return value is always a "DebugPromiseLike", -// but having an "| {}" makes it harder to accidentally use. -export function act(callback: () => void | undefined): DebugPromiseLike | {}; +// the actual return value is always a "DebugPromiseLike". +export function act(callback: () => void | undefined): DebugPromiseLike; // Intentionally doesn't extend PromiseLike. // Ideally this should be as hard to accidentally use as possible.