Socket
Socket
Sign inDemoInstall

@testing-library/dom

Package Overview
Dependencies
Maintainers
16
Versions
228
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@testing-library/dom - npm Package Compare versions

Comparing version 8.4.0 to 8.5.0

3

dist/config.js

@@ -18,3 +18,3 @@ "use strict";

asyncUtilTimeout: 1000,
// this is to support React's async `act` function.
// asyncWrapper and advanceTimersWrapper is to support React's async `act` function.
// forcing react-testing-library to wrap all async functions would've been

@@ -27,2 +27,3 @@ // a total nightmare (consider wrapping every findBy* query and then also

asyncWrapper: cb => cb(),
unstable_advanceTimersWrapper: cb => cb(),
eventWrapper: cb => cb(),

@@ -29,0 +30,0 @@ // default value for the `hidden` option in `ByRole` queries

@@ -47,2 +47,5 @@ "use strict";

if (usingJestFakeTimers) {
const {
unstable_advanceTimersWrapper: advanceTimersWrapper
} = (0, _config.getConfig)();
checkCallback(); // this is a dangerous rule to disable because it could lead to an

@@ -67,3 +70,5 @@ // infinite loop. However, eslint isn't smart enough to know that we're

jest.advanceTimersByTime(interval); // It's really important that checkCallback is run *before* we flush
advanceTimersWrapper(() => {
jest.advanceTimersByTime(interval);
}); // It's really important that checkCallback is run *before* we flush
// in-flight promises. To be honest, I'm not sure why, and I can't quite

@@ -79,5 +84,7 @@ // think of a way to reproduce the problem in a test, but I spent

await new Promise(r => {
setTimeout(r, 0);
jest.advanceTimersByTime(0);
await advanceTimersWrapper(async () => {
await new Promise(r => {
setTimeout(r, 0);
jest.advanceTimersByTime(0);
});
});

@@ -84,0 +91,0 @@ }

{
"name": "@testing-library/dom",
"version": "8.4.0",
"version": "8.5.0",
"description": "Simple and complete DOM testing utilities that encourage good testing practices.",

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

export interface Config {
testIdAttribute: string
/**
* WARNING: `unstable` prefix means this API may change in patch and minor releases.
* @param cb
*/
unstable_advanceTimersWrapper(cb: (...args: unknown[]) => unknown): unknown
// eslint-disable-next-line @typescript-eslint/no-explicit-any

@@ -4,0 +9,0 @@ asyncWrapper(cb: (...args: any[]) => any): Promise<any>

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

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