From dcd501f22e85c2eb1dd7a90866e1b87b73fecf64 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Mon, 2 Oct 2023 18:54:24 +0200 Subject: [PATCH] Fixes --- .eslintrc.cjs | 1 + package.json | 1 + pnpm-lock.yaml | 40 +++++++++++++++++++++++++++++++++------- src/connect.test.tsx | 2 ++ src/connect.tsx | 1 + src/mockReactRedux.ts | 2 ++ src/selectors.ts | 2 ++ src/types.ts | 2 ++ 8 files changed, 44 insertions(+), 7 deletions(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 4256b0b..4dfd9ac 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -99,6 +99,7 @@ module.exports = { // These on-by-default rules aren't useful in test files. "@typescript-eslint/no-unsafe-assignment": "off", "@typescript-eslint/no-unsafe-call": "off", + "jest/expect-expect": "off", }, }, { diff --git a/package.json b/package.json index 7b58619..7fc5a56 100644 --- a/package.json +++ b/package.json @@ -46,6 +46,7 @@ "@release-it/conventional-changelog": "^7.0.2", "@testing-library/react": "^10.0.4", "@types/eslint": "^8.44.3", + "@types/jest": "^29.5.5", "@types/lodash.mapvalues": "^4.6.6", "@types/node": "^20.5.9", "@types/react-dom": "^18.2.7", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8a2a182..da22f3f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -21,10 +21,13 @@ devDependencies: version: 7.0.2(release-it@16.2.1) '@testing-library/react': specifier: ^10.0.4 - version: 10.4.9(react-dom@react-dom)(react@16.14.0) + version: 10.4.9(react-dom@18.2.0)(react@16.14.0) '@types/eslint': specifier: ^8.44.3 version: 8.44.3 + '@types/jest': + specifier: ^29.5.5 + version: 29.5.5 '@types/lodash.mapvalues': specifier: ^4.6.6 version: 4.6.7 @@ -126,10 +129,10 @@ devDependencies: version: 16.14.0 react-dom: specifier: link:react-dom - version: link:react-dom + version: 18.2.0(react@16.14.0) react-redux: specifier: ^7.2.0 - version: 7.2.9(react-dom@react-dom)(react@16.14.0) + version: 7.2.9(react-dom@18.2.0)(react@16.14.0) release-it: specifier: ^16.2.1 version: 16.2.1(typescript@5.2.2) @@ -1707,7 +1710,7 @@ packages: pretty-format: 26.6.2 dev: true - /@testing-library/react@10.4.9(react-dom@react-dom)(react@16.14.0): + /@testing-library/react@10.4.9(react-dom@18.2.0)(react@16.14.0): resolution: {integrity: sha512-pHZKkqUy0tmiD81afs8xfiuseXfU/N7rAX3iKjeZYje86t9VaB0LrxYVa+OOsvkrveX5jCK3IjajVn2MbePvqA==} engines: {node: '>=10'} peerDependencies: @@ -1717,7 +1720,7 @@ packages: '@babel/runtime': 7.22.15 '@testing-library/dom': 7.31.2 react: 16.14.0 - react-dom: link:react-dom + react-dom: 18.2.0(react@16.14.0) dev: true /@tootallnate/quickjs-emscripten@0.23.0: @@ -1800,6 +1803,13 @@ packages: '@types/istanbul-lib-report': 3.0.0 dev: true + /@types/jest@29.5.5: + resolution: {integrity: sha512-ebylz2hnsWR9mYvmBFbXJXr+33UPc4+ZdxyDXh5w0FlPBTfCVN3wPL+kuOiQt3xvrK419v7XWeAs+AeOksafXg==} + dependencies: + expect: 29.7.0 + pretty-format: 29.7.0 + dev: true + /@types/json-schema@7.0.12: resolution: {integrity: sha512-Hr5Jfhc9eYOQNPYO5WLDq/n4jqijdHNlDXjuAQkkt+mWdQR+XJToOHrsD4cPaMXpn6KO7y2+wM8AZEs8VpBLVA==} dev: true @@ -6767,6 +6777,16 @@ packages: strip-json-comments: 2.0.1 dev: true + /react-dom@18.2.0(react@16.14.0): + resolution: {integrity: sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==} + peerDependencies: + react: ^18.2.0 + dependencies: + loose-envify: 1.4.0 + react: 16.14.0 + scheduler: 0.23.0 + dev: true + /react-is@16.13.1: resolution: {integrity: sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==} @@ -6778,7 +6798,7 @@ packages: resolution: {integrity: sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==} dev: true - /react-redux@7.2.9(react-dom@react-dom)(react@16.14.0): + /react-redux@7.2.9(react-dom@18.2.0)(react@16.14.0): resolution: {integrity: sha512-Gx4L3uM182jEEayZfRbI/G11ZpYdNAnBs70lFVMNdHJI76XYtR+7m0MN+eAs7UHBPhWXcnFPaS+9owSCJQHNpQ==} peerDependencies: react: ^16.8.3 || ^17 || ^18 @@ -6796,7 +6816,7 @@ packages: loose-envify: 1.4.0 prop-types: 15.8.1 react: 16.14.0 - react-dom: link:react-dom + react-dom: 18.2.0(react@16.14.0) react-is: 17.0.2 dev: true @@ -7135,6 +7155,12 @@ packages: resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} dev: true + /scheduler@0.23.0: + resolution: {integrity: sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==} + dependencies: + loose-envify: 1.4.0 + dev: true + /scslre@0.2.0: resolution: {integrity: sha512-4hc49fUMmX3jM0XdFUAPBrs1xwEcdHa0KyjEsjFs+Zfc66mpFpq5YmRgDtl+Ffo6AtJIilfei+yKw8fUn3N88w==} dependencies: diff --git a/src/connect.test.tsx b/src/connect.test.tsx index 6681dff..29f0b92 100644 --- a/src/connect.test.tsx +++ b/src/connect.test.tsx @@ -1,3 +1,5 @@ +import type * as jest from "jest"; + import { render } from "@testing-library/react"; import React, { useEffect } from "react"; import { act } from "react-dom/test-utils"; diff --git a/src/connect.tsx b/src/connect.tsx index 967f232..cdf110e 100644 --- a/src/connect.tsx +++ b/src/connect.tsx @@ -1,3 +1,4 @@ +import type * as jest from "jest"; import type { MapDispatchToProps, MapStateToProps } from "react-redux"; import mapValues from "lodash.mapvalues"; diff --git a/src/mockReactRedux.ts b/src/mockReactRedux.ts index 63f8980..abc02ef 100644 --- a/src/mockReactRedux.ts +++ b/src/mockReactRedux.ts @@ -1,3 +1,5 @@ +import type * as jest from "jest"; + import { mockConnect } from "./connect.js"; import { GetSelector, createGetSelector } from "./selectors.js"; import { AnySelector, MockReactRedux } from "./types.js"; diff --git a/src/selectors.ts b/src/selectors.ts index e4915ca..7dc2ca9 100644 --- a/src/selectors.ts +++ b/src/selectors.ts @@ -1,3 +1,5 @@ +import type * as jest from "jest"; + import { AnySelector } from "./types.js"; export type GetSelector = ( diff --git a/src/types.ts b/src/types.ts index 371cfa9..5f5ecf9 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,3 +1,5 @@ +import type * as jest from "jest"; + /** * Test APIs to modify the mocked react-redux hooks' behavior. */