Skip to content
This repository has been archived by the owner on Oct 1, 2024. It is now read-only.

Commit

Permalink
Update the jest Matches types to support the new type
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandcote committed Feb 22, 2020
1 parent b410ce0 commit 51e7097
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 19 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"@types/enzyme": "^3.1.10",
"@types/enzyme-adapter-react-16": "^1.0.3",
"@types/faker": "^4.1.5",
"@types/jest": "^24.0.18",
"@types/jest": "^24.9.1",
"@types/puppeteer": "^1.20.0",
"@types/react": "16.9.19",
"@types/react-dom": "^16.9.5",
Expand Down
2 changes: 1 addition & 1 deletion packages/ast-utilities/src/matchers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
declare global {
// eslint-disable-next-line @typescript-eslint/no-namespace
namespace jest {
interface Matchers<R> {
interface Matchers<R, T> {
toBeFormated(expected: string): void;
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/graphql-testing/src/matchers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {toHavePerformedGraphQLOperation} from './operations';
declare global {
// eslint-disable-next-line @typescript-eslint/no-namespace
namespace jest {
interface Matchers<R> {
interface Matchers<R, T> {
toHavePerformedGraphQLOperation<Variables>(
document: GraphQLOperation<any, Variables, any>,
variables?: Partial<Variables>,
Expand Down
2 changes: 1 addition & 1 deletion packages/react-i18n/src/test/matchers.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
declare global {
// eslint-disable-next-line @typescript-eslint/no-namespace
namespace jest {
interface Matchers<R> {
interface Matchers<R, T> {
toBeArrayOfUniqueItems(): void;
}
}
Expand Down
4 changes: 3 additions & 1 deletion packages/react-testing/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

<!-- ## [Unreleased] -->
## [Unreleased]

- Support `@types/jest^24.0.20` and higher.

## [1.8.0] - 2019-10-08

Expand Down
4 changes: 2 additions & 2 deletions packages/react-testing/src/matchers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ type PropsFromNode<T> = T extends Node<infer U> ? U : never;
declare global {
// eslint-disable-next-line @typescript-eslint/no-namespace
namespace jest {
interface Matchers<R> {
toHaveReactProps(props: Partial<PropsFromNode<R>>): void;
interface Matchers<R, T> {
toHaveReactProps(props: Partial<PropsFromNode<T>>): void;
toHaveReactDataProps(data: {[key: string]: string}): void;
toContainReactComponent<Type extends string | ComponentType<any>>(
type: Type,
Expand Down
2 changes: 1 addition & 1 deletion test/matchers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import 'jest-enzyme';
declare global {
// eslint-disable-next-line @typescript-eslint/no-namespace
namespace jest {
interface Matchers<R> {
interface Matchers<R, T> {
toBeArrayOfUniqueItems(): void;
}
}
Expand Down
17 changes: 6 additions & 11 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1372,17 +1372,12 @@
"@types/istanbul-lib-coverage" "*"
"@types/istanbul-lib-report" "*"

"@types/jest-diff@*":
version "20.0.1"
resolved "https://registry.yarnpkg.com/@types/jest-diff/-/jest-diff-20.0.1.tgz#35cc15b9c4f30a18ef21852e255fdb02f6d59b89"
integrity sha512-yALhelO3i0hqZwhjtcr6dYyaLoCHbAMshwtj6cGxTvHZAKXHsYGdff6E8EPw3xLKY0ELUTQ69Q1rQiJENnccMA==

"@types/jest@^24.0.18":
version "24.0.19"
resolved "https://registry.yarnpkg.com/@types/jest/-/jest-24.0.19.tgz#f7036058d2a5844fe922609187c0ad8be430aff5"
integrity sha512-YYiqfSjocv7lk5H/T+v5MjATYjaTMsUkbDnjGqSMoO88jWdtJXJV4ST/7DKZcoMHMBvB2SeSfyOzZfkxXHR5xg==
"@types/jest@^24.9.1":
version "24.9.1"
resolved "https://registry.yarnpkg.com/@types/jest/-/jest-24.9.1.tgz#02baf9573c78f1b9974a5f36778b366aa77bd534"
integrity sha512-Fb38HkXSVA4L8fGKEZ6le5bB8r6MRWlOCZbVuWZcmOMSCd2wCYOwN1ibj8daIoV9naq7aaOZjrLCoCMptKU/4Q==
dependencies:
"@types/jest-diff" "*"
jest-diff "^24.3.0"

"@types/json-schema@^7.0.3":
version "7.0.3"
Expand Down Expand Up @@ -6403,7 +6398,7 @@ jest-config@^24.9.0:
pretty-format "^24.9.0"
realpath-native "^1.1.0"

jest-diff@^24.9.0:
jest-diff@^24.3.0, jest-diff@^24.9.0:
version "24.9.0"
resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-24.9.0.tgz#931b7d0d5778a1baf7452cb816e325e3724055da"
integrity sha512-qMfrTs8AdJE2iqrTp0hzh7kTd2PQWrsFyj9tORoKmu32xjPjeE4NyjVRDz8ybYwqS2ik8N4hsIpiVTyFeo2lBQ==
Expand Down

0 comments on commit 51e7097

Please sign in to comment.