Prepare for TS #32460 (#37057)

* Prepare for TS #32460

* Revert change
This commit is contained in:
Anders Hejlsberg 2019-07-23 10:15:26 -07:00 committed by GitHub
parent 518db0303d
commit b4584a24c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 6 deletions

View File

@ -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<never>.
// Ideally this should be as hard to accidentally use as possible.

View File

@ -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<never>.
// Ideally this should be as hard to accidentally use as possible.