Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@testing-library/react-hooks

Package Overview
Dependencies
Maintainers
16
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@testing-library/react-hooks - npm Package Compare versions

Comparing version 5.0.0-beta.2 to 5.0.0-beta.3

3

lib/core/index.d.ts

@@ -1,5 +0,4 @@

import { CreateRenderer, Renderer, RenderHook } from '../types';
import { RenderHookOptions } from '../types/internal';
import { CreateRenderer, Renderer, RenderHook, RenderHookOptions } from '../types';
import { cleanup, addCleanup, removeCleanup } from './cleanup';
declare const createRenderHook: <TProps, TResult, TOptions extends {}, TRenderer extends Renderer<TProps>>(createRenderer: CreateRenderer<TProps, TResult, TOptions, TRenderer>) => (callback: (props: TProps) => TResult, options?: RenderHookOptions<TProps, TOptions>) => RenderHook<TProps, TResult, TRenderer>;
export { createRenderHook, cleanup, addCleanup, removeCleanup };
import { act } from 'react-dom/test-utils';
import { RendererOptions } from '../types/react';
import { cleanup, addCleanup, removeCleanup } from '../core';
declare const renderHook: <TProps, TResult>(callback: (props: TProps) => TResult, options?: import("../types/internal").RenderHookOptions<TProps, RendererOptions<TProps>>) => import("../types").RenderHook<TProps, TResult, {
declare const renderHook: <TProps, TResult>(callback: (props: TProps) => TResult, options?: import("../types").RenderHookOptions<TProps, RendererOptions<TProps>>) => import("../types").RenderHook<TProps, TResult, {
render(props?: TProps | undefined): void;

@@ -6,0 +6,0 @@ rerender(props?: TProps | undefined): void;

import { act } from 'react-test-renderer';
import { RendererOptions } from '../types/react';
import { cleanup, addCleanup, removeCleanup } from '../core';
declare const renderHook: <TProps, TResult>(callback: (props: TProps) => TResult, options?: import("../types/internal").RenderHookOptions<TProps, RendererOptions<TProps>>) => import("../types").RenderHook<TProps, TResult, {
declare const renderHook: <TProps, TResult>(callback: (props: TProps) => TResult, options?: import("../types").RenderHookOptions<TProps, RendererOptions<TProps>>) => import("../types").RenderHook<TProps, TResult, {
render(props?: TProps | undefined): void;

@@ -6,0 +6,0 @@ rerender(props?: TProps | undefined): void;

@@ -1,4 +0,4 @@

declare const renderHook: <TProps, TResult>() => import("./types").RenderHook<TProps, TResult, import("./types").Renderer<TProps>>, act: import("./types").Act, cleanup: () => void, addCleanup: (callback: () => void | Promise<void>) => () => void, removeCleanup: (callback: () => void | Promise<void>) => void;
declare const renderHook: <TProps, TResult, TOptions>(callback: (props: TProps) => TResult, options?: import("./types").RenderHookOptions<TProps, TOptions> | undefined) => import("./types").RenderHook<TProps, TResult, import("./types").Renderer<TProps>>, act: import("./types").Act, cleanup: () => void, addCleanup: (callback: () => void | Promise<void>) => () => void, removeCleanup: (callback: () => void | Promise<void>) => void;
export { renderHook, act, cleanup, addCleanup, removeCleanup };
export * from './types';
export * from './types/react';
import { act } from 'react-dom/test-utils';
import { RendererOptions } from '../types/react';
import { cleanup, addCleanup, removeCleanup } from '../core';
declare const renderHook: <TProps, TResult>(callback: (props: TProps) => TResult, options?: import("../types/internal").RenderHookOptions<TProps, RendererOptions<TProps>>) => import("../types").RenderHook<TProps, TResult, {
declare const renderHook: <TProps, TResult>(callback: (props: TProps) => TResult, options?: import("../types").RenderHookOptions<TProps, RendererOptions<TProps>>) => import("../types").RenderHook<TProps, TResult, {
render(props?: TProps | undefined): void;

@@ -6,0 +6,0 @@ hydrate(): void;

@@ -33,3 +33,3 @@ export declare type Renderer<TProps> = {

export interface ReactHooksRenderer {
renderHook: <TProps, TResult>() => RenderHook<TProps, TResult>;
renderHook: <TProps, TResult, TOptions>(callback: (props: TProps) => TResult, options?: RenderHookOptions<TProps, TOptions>) => RenderHook<TProps, TResult>;
act: Act;

@@ -40,2 +40,5 @@ cleanup: () => void;

}
export declare type RenderHookOptions<TProps, TOptions extends {}> = TOptions & {
initialProps?: TProps;
};
export interface Act {

@@ -42,0 +45,0 @@ (callback: () => void | undefined): void;

@@ -8,4 +8,1 @@ import { RenderResult } from '.';

};
export declare type RenderHookOptions<TProps, TOptions extends {}> = TOptions & {
initialProps?: TProps;
};
{
"name": "@testing-library/react-hooks",
"version": "5.0.0-beta.2",
"version": "5.0.0-beta.3",
"description": "Simple and complete React hooks testing utilities that encourage good testing practices.",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -1,3 +0,3 @@

import { CreateRenderer, Renderer, RenderResult, RenderHook } from '../types'
import { ResultContainer, RenderHookOptions } from '../types/internal'
import { CreateRenderer, Renderer, RenderResult, RenderHook, RenderHookOptions } from '../types'
import { ResultContainer } from '../types/internal'

@@ -4,0 +4,0 @@ import asyncUtils from './asyncUtils'

@@ -51,3 +51,6 @@ export type Renderer<TProps> = {

export interface ReactHooksRenderer {
renderHook: <TProps, TResult>() => RenderHook<TProps, TResult>
renderHook: <TProps, TResult, TOptions>(
callback: (props: TProps) => TResult,
options?: RenderHookOptions<TProps, TOptions>
) => RenderHook<TProps, TResult>
act: Act

@@ -59,2 +62,6 @@ cleanup: () => void

export type RenderHookOptions<TProps, TOptions extends {}> = TOptions & {
initialProps?: TProps
}
export interface Act {

@@ -61,0 +68,0 @@ (callback: () => void | undefined): void

@@ -9,5 +9,1 @@ import { RenderResult } from '.'

}
export type RenderHookOptions<TProps, TOptions extends {}> = TOptions & {
initialProps?: TProps
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc