Socket
Socket
Sign inDemoInstall

@testing-library/dom

Package Overview
Dependencies
Maintainers
12
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 7.2.2 to 7.3.0

2

dist/config.js

@@ -27,2 +27,4 @@ "use strict";

defaultHidden: false,
//showOriginalStackTrace flag to show the full error stack traces for async errors
showOriginalStackTrace: false,

@@ -29,0 +31,0 @@ // called when getBy* queries fail. (message, container) => Error

@@ -13,5 +13,13 @@ "use strict";

// This is so the stack trace the developer sees is one that's
// closer to their code (because async stack traces are hard to follow).
function copyStackTrace(target, source) {
target.stack = source.stack.replace(source.message, target.message);
}
function waitFor(callback, {
container = (0, _helpers.getDocument)(),
timeout = (0, _config.getConfig)().asyncUtilTimeout,
showOriginalStackTrace = (0, _config.getConfig)().showOriginalStackTrace,
stackTraceError,
interval = 50,

@@ -24,9 +32,7 @@ mutationObserverOptions = {

}
} = {}) {
}) {
if (typeof callback !== 'function') {
throw new TypeError('Received `callback` arg must be a function');
} // created here so we get a nice stacktrace
}
const timedOutError = new Error('Timed out in waitFor.');
if (interval < 1) interval = 1;

@@ -66,3 +72,19 @@ return new Promise((resolve, reject) => {

function onTimeout() {
onDone(lastError || timedOutError, null);
let error;
if (lastError) {
error = lastError;
if (!showOriginalStackTrace && error.name === 'TestingLibraryElementError') {
copyStackTrace(error, stackTraceError);
}
} else {
error = new Error('Timed out in waitFor.');
if (!showOriginalStackTrace) {
copyStackTrace(error, stackTraceError);
}
}
onDone(error, null);
}

@@ -72,4 +94,10 @@ });

function waitForWrapper(...args) {
return (0, _config.getConfig)().asyncWrapper(() => waitFor(...args));
function waitForWrapper(callback, options) {
// create the error here so its stack trace is as close to the
// calling code as possible
const stackTraceError = new Error('STACK_TRACE_MESSAGE');
return (0, _config.getConfig)().asyncWrapper(() => waitFor(callback, {
stackTraceError,
...options
}));
}

@@ -76,0 +104,0 @@

16

package.json
{
"name": "@testing-library/dom",
"version": "7.2.2",
"version": "7.3.0",
"description": "Simple and complete DOM testing utilities that encourage good testing practices.",

@@ -38,15 +38,15 @@ "main": "dist/index.js",

"dependencies": {
"@babel/runtime": "^7.9.2",
"@types/testing-library__dom": "^7.0.0",
"@babel/runtime": "^7.9.6",
"@types/testing-library__dom": "^7.0.2",
"aria-query": "^4.0.2",
"dom-accessibility-api": "^0.4.2",
"pretty-format": "^25.1.0"
"dom-accessibility-api": "^0.4.3",
"pretty-format": "^26.0.1"
},
"devDependencies": {
"@testing-library/jest-dom": "^5.1.1",
"@testing-library/jest-dom": "^5.5.0",
"jest-in-case": "^1.0.2",
"jest-serializer-ansi": "^1.0.3",
"jest-watch-select-projects": "^2.0.0",
"jsdom": "^16.2.1",
"kcd-scripts": "^5.6.0"
"jsdom": "^16.2.2",
"kcd-scripts": "^5.11.1"
},

@@ -53,0 +53,0 @@ "eslintConfig": {

@@ -248,2 +248,3 @@ <div align="center">

<td align="center"><a href="http://kwboyd.com"><img src="https://avatars0.githubusercontent.com/u/13855750?v=4" width="100px;" alt=""/><br /><sub><b>Kate W. Boyd</b></sub></a><br /><a href="https://github.com/testing-library/dom-testing-library/commits?author=kwboyd" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/rahulchavan30"><img src="https://avatars2.githubusercontent.com/u/5296464?v=4" width="100px;" alt=""/><br /><sub><b>Rahul Suryakanth</b></sub></a><br /><a href="https://github.com/testing-library/dom-testing-library/commits?author=rahulchavan30" title="Code">💻</a> <a href="https://github.com/testing-library/dom-testing-library/commits?author=rahulchavan30" title="Tests">⚠️</a></td>
</tr>

@@ -250,0 +251,0 @@ </table>

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

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