@testing-library/dom
Advanced tools
Comparing version 9.2.0 to 9.3.0
@@ -13,3 +13,2 @@ "use strict"; | ||
*/ | ||
/** | ||
@@ -16,0 +15,0 @@ * @param {HTMLElement} element container |
@@ -57,8 +57,14 @@ "use strict"; | ||
} | ||
// we *could* (maybe should?) use `advanceTimersToNextTimer` but it's | ||
// possible that could make this loop go on forever if someone is using | ||
// third party code that's setting up recursive timers so rapidly that | ||
// the user's timer's don't get a chance to resolve. So we'll advance | ||
// by an interval instead. (We have a test for this case). | ||
advanceTimersWrapper(() => { | ||
// In this rare case, we *need* to wait for in-flight promises | ||
// to resolve before continuing. We don't need to take advantage | ||
// of parallelization so we're fine. | ||
// https://stackoverflow.com/a/59243586/971592 | ||
// eslint-disable-next-line no-await-in-loop | ||
await advanceTimersWrapper(async () => { | ||
// we *could* (maybe should?) use `advanceTimersToNextTimer` but it's | ||
// possible that could make this loop go on forever if someone is using | ||
// third party code that's setting up recursive timers so rapidly that | ||
// the user's timer's don't get a chance to resolve. So we'll advance | ||
// by an interval instead. (We have a test for this case). | ||
jest.advanceTimersByTime(interval); | ||
@@ -75,14 +81,2 @@ }); | ||
} | ||
// In this rare case, we *need* to wait for in-flight promises | ||
// to resolve before continuing. We don't need to take advantage | ||
// of parallelization so we're fine. | ||
// https://stackoverflow.com/a/59243586/971592 | ||
// eslint-disable-next-line no-await-in-loop | ||
await advanceTimersWrapper(async () => { | ||
await new Promise(r => { | ||
setTimeout(r, 0); | ||
jest.advanceTimersByTime(0); | ||
}); | ||
}); | ||
} | ||
@@ -89,0 +83,0 @@ } else { |
{ | ||
"name": "@testing-library/dom", | ||
"version": "9.2.0", | ||
"version": "9.3.0", | ||
"description": "Simple and complete DOM testing utilities that encourage good testing practices.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2953866
25466