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
10
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 1.1.0 to 2.0.0

14

lib/index.js

@@ -120,8 +120,18 @@ "use strict";

update = _testRenderer.update;
var waitingForNextUpdate = null;
var resolveOnNextUpdate = function resolveOnNextUpdate(resolve) {
addResolver(function () {
waitingForNextUpdate = null;
resolve.apply(void 0, arguments);
});
};
return {
result: result,
waitForNextUpdate: function waitForNextUpdate() {
return new Promise(function (resolve) {
return addResolver(resolve);
waitingForNextUpdate = waitingForNextUpdate || (0, _reactTestRenderer.act)(function () {
return new Promise(resolveOnNextUpdate);
});
return waitingForNextUpdate;
},

@@ -128,0 +138,0 @@ rerender: function rerender(newProps) {

44

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

@@ -39,37 +39,37 @@ "main": "lib/index.js",

"dependencies": {
"@babel/runtime": "^7.4.2",
"@types/react": "^16.8.22",
"@types/react-test-renderer": "^16.8.2"
"@babel/runtime": "^7.5.4",
"@types/react": ">=16.9.0",
"@types/react-test-renderer": ">=16.9.0"
},
"devDependencies": {
"@babel/cli": "7.4.4",
"@babel/core": "7.4.5",
"@babel/plugin-proposal-object-rest-spread": "7.4.4",
"@babel/plugin-transform-modules-commonjs": "7.4.4",
"@babel/plugin-transform-runtime": "7.4.4",
"@babel/preset-env": "7.4.5",
"@babel/cli": "7.5.5",
"@babel/core": "7.5.5",
"@babel/plugin-proposal-object-rest-spread": "7.5.5",
"@babel/plugin-transform-modules-commonjs": "7.5.0",
"@babel/plugin-transform-runtime": "7.5.5",
"@babel/preset-env": "7.5.5",
"@babel/preset-react": "7.0.0",
"all-contributors-cli": "6.7.0",
"all-contributors-cli": "6.8.1",
"babel-eslint": "10.0.2",
"babel-plugin-module-resolver": "3.2.0",
"codecov": "3.5.0",
"docz": "^1.0.4",
"docz-theme-default": "^1.0.4",
"eslint": "6.0.0",
"eslint-config-prettier": "5.0.0",
"docz": "1.2.0",
"docz-theme-default": "1.2.0",
"eslint": "6.1.0",
"eslint-config-prettier": "6.0.0",
"eslint-plugin-prettier": "3.1.0",
"husky": "2.4.1",
"husky": "3.0.3",
"jest": "24.8.0",
"lint-staged": "8.2.1",
"lint-staged": "9.2.1",
"prettier": "1.18.2",
"prettier-eslint": "9.0.0",
"prettier-eslint-cli": "5.0.0",
"react": "16.8.6",
"react-test-renderer": "16.8.6",
"typescript": "3.5.2",
"react": "16.9.0",
"react-test-renderer": "16.9.0",
"typescript": "3.5.3",
"typings-tester": "0.3.2"
},
"peerDependencies": {
"react": ">=16.8.0",
"react-test-renderer": ">=16.8.0"
"react": ">=16.9.0",
"react-test-renderer": ">=16.9.0"
},

@@ -76,0 +76,0 @@ "jest": {

@@ -76,5 +76,16 @@ import React, { Suspense } from 'react'

let waitingForNextUpdate = null
const resolveOnNextUpdate = (resolve) => {
addResolver((...args) => {
waitingForNextUpdate = null
resolve(...args)
})
}
return {
result,
waitForNextUpdate: () => new Promise((resolve) => addResolver(resolve)),
waitForNextUpdate: () => {
waitingForNextUpdate = waitingForNextUpdate || act(() => new Promise(resolveOnNextUpdate))
return waitingForNextUpdate
},
rerender: (newProps = hookProps.current) => {

@@ -81,0 +92,0 @@ hookProps.current = newProps

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