From 809d8971ccfb656749655909b699138b66ddff04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20C=C3=B4t=C3=A9?= Date: Fri, 21 Feb 2020 19:41:57 -0500 Subject: [PATCH] Update the jest Matches types to support the new type --- package.json | 2 +- packages/react-testing/CHANGELOG.md | 4 +++- packages/react-testing/src/matchers/index.ts | 4 ++-- yarn.lock | 17 ++++++----------- 4 files changed, 12 insertions(+), 15 deletions(-) diff --git a/package.json b/package.json index 16c5880ec1..967c588b32 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/packages/react-testing/CHANGELOG.md b/packages/react-testing/CHANGELOG.md index 61058f4667..3d46649fd3 100644 --- a/packages/react-testing/CHANGELOG.md +++ b/packages/react-testing/CHANGELOG.md @@ -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] + +- Type error while using `[toHaveReactProps](https://github.com/Shopify/quilt/issues/1212) is now resolved by updating`@types/jest`to`24.9.1`. [#1212](https://github.com/Shopify/quilt/issues/1212) ## [1.8.0] - 2019-10-08 diff --git a/packages/react-testing/src/matchers/index.ts b/packages/react-testing/src/matchers/index.ts index 295d478b88..a87e2ad8bb 100644 --- a/packages/react-testing/src/matchers/index.ts +++ b/packages/react-testing/src/matchers/index.ts @@ -15,8 +15,8 @@ type PropsFromNode = T extends Node ? U : never; declare global { // eslint-disable-next-line @typescript-eslint/no-namespace namespace jest { - interface Matchers { - toHaveReactProps(props: Partial>): void; + interface Matchers { + toHaveReactProps(props: Partial>): void; toHaveReactDataProps(data: {[key: string]: string}): void; toContainReactComponent>( type: Type, diff --git a/yarn.lock b/yarn.lock index 3d1d388ada..e8a7dd5489 100644 --- a/yarn.lock +++ b/yarn.lock @@ -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" @@ -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==