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

@testing-library/react

Package Overview
Dependencies
Maintainers
15
Versions
117
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@testing-library/react - npm Package Compare versions

Comparing version 15.0.2 to 15.0.3

2

package.json
{
"name": "@testing-library/react",
"version": "15.0.2",
"version": "15.0.3",
"description": "Simple and complete React DOM testing utilities that encourage good testing practices.",

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

// TypeScript Version: 3.8
import * as ReactDOMClient from 'react-dom/client'
import {

@@ -46,6 +46,6 @@ queries,

export interface RenderOptions<
Q extends Queries = typeof queries,
Container extends Element | DocumentFragment = HTMLElement,
BaseElement extends Element | DocumentFragment = Container,
export interface BaseRenderOptions<
Q extends Queries,
Container extends RendererableContainer | HydrateableContainer,
BaseElement extends Element | DocumentFragment,
> {

@@ -97,2 +97,40 @@ /**

type RendererableContainer = ReactDOMClient.Container
type HydrateableContainer = Parameters<typeof ReactDOMClient['hydrateRoot']>[0]
export interface ClientRenderOptions<
Q extends Queries,
Container extends Element | DocumentFragment,
BaseElement extends Element | DocumentFragment = Container,
> extends BaseRenderOptions<Q, Container, BaseElement> {
/**
* If `hydrate` is set to `true`, then it will render with `ReactDOM.hydrate`. This may be useful if you are using server-side
* rendering and use ReactDOM.hydrate to mount your components.
*
* @see https://testing-library.com/docs/react-testing-library/api/#hydrate)
*/
hydrate?: false | undefined
}
export interface HydrateOptions<
Q extends Queries,
Container extends Element | DocumentFragment,
BaseElement extends Element | DocumentFragment = Container,
> extends BaseRenderOptions<Q, Container, BaseElement> {
/**
* If `hydrate` is set to `true`, then it will render with `ReactDOM.hydrate`. This may be useful if you are using server-side
* rendering and use ReactDOM.hydrate to mount your components.
*
* @see https://testing-library.com/docs/react-testing-library/api/#hydrate)
*/
hydrate: true
}
export type RenderOptions<
Q extends Queries = typeof queries,
Container extends RendererableContainer | HydrateableContainer = HTMLElement,
BaseElement extends Element | DocumentFragment = Container,
> =
| ClientRenderOptions<Q, Container, BaseElement>
| HydrateOptions<Q, Container, BaseElement>
type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>

@@ -105,8 +143,16 @@

Q extends Queries = typeof queries,
Container extends Element | DocumentFragment = HTMLElement,
Container extends RendererableContainer = HTMLElement,
BaseElement extends Element | DocumentFragment = Container,
>(
ui: React.ReactNode,
options: RenderOptions<Q, Container, BaseElement>,
options: ClientRenderOptions<Q, Container, BaseElement>,
): RenderResult<Q, Container, BaseElement>
export function render<
Q extends Queries = typeof queries,
Container extends HydrateableContainer = HTMLElement,
BaseElement extends Element | DocumentFragment = Container,
>(
ui: React.ReactNode,
options: HydrateOptions<Q, Container, BaseElement>,
): RenderResult<Q, Container, BaseElement>
export function render(

@@ -113,0 +159,0 @@ ui: React.ReactNode,

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