diff --git a/config/typescript/matchers.d.ts b/config/typescript/matchers.d.ts new file mode 100644 index 0000000000..4b85637e87 --- /dev/null +++ b/config/typescript/matchers.d.ts @@ -0,0 +1,30 @@ +import {ComponentType, Context as ReactContext} from 'react'; +import type {} from 'saddle-up/matchers'; +import type {} from 'saddle-up/koa-matchers'; + +// @shopify/react-testing/matchers +declare 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; + toHaveReactDataProps(data: {[key: string]: string}): void; + toContainReactComponent>( + type: Type, + props?: Partial>, + ): void; + toContainReactComponentTimes>( + type: Type, + times: number, + props?: Partial>, + ): void; + toProvideReactContext( + context: ReactContext, + value?: Type, + ): void; + toContainReactText(text: string): void; + toContainReactHtml(text: string): void; + } + } +} diff --git a/packages/react-app-bridge-universal-provider/CHANGELOG.md b/packages/react-app-bridge-universal-provider/CHANGELOG.md index 74bd9c78d2..3615b61966 100644 --- a/packages/react-app-bridge-universal-provider/CHANGELOG.md +++ b/packages/react-app-bridge-universal-provider/CHANGELOG.md @@ -5,7 +5,11 @@ 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 + +### Changed + +- Enable type checking in tests and fix type errors. [[#2011](https://github.com/Shopify/quilt/pull/2016)] ## 2.1.5 - 2021-08-30 diff --git a/packages/react-app-bridge-universal-provider/tsconfig.json b/packages/react-app-bridge-universal-provider/tsconfig.json index 3b21117610..7784eb9609 100644 --- a/packages/react-app-bridge-universal-provider/tsconfig.json +++ b/packages/react-app-bridge-universal-provider/tsconfig.json @@ -10,6 +10,5 @@ "./src/**/*.ts", "./src/**/*.tsx" ], - "exclude": ["**/test/**/*", "**/tests/**/*"], "references": [{"path": "../react-html"}] } diff --git a/packages/react-compose/CHANGELOG.md b/packages/react-compose/CHANGELOG.md index 4de21d61c6..00579e3ad5 100644 --- a/packages/react-compose/CHANGELOG.md +++ b/packages/react-compose/CHANGELOG.md @@ -5,7 +5,11 @@ 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 + +### Changed + +- Enable type checking in tests and fix type errors. [[#2011](https://github.com/Shopify/quilt/pull/2016)] ## 2.1.3 - 2021-08-24 diff --git a/packages/react-compose/tsconfig.json b/packages/react-compose/tsconfig.json index fd8f22d114..4586c1dca1 100644 --- a/packages/react-compose/tsconfig.json +++ b/packages/react-compose/tsconfig.json @@ -10,6 +10,5 @@ "./src/**/*.ts", "./src/**/*.tsx" ], - "exclude": ["**/test/**/*", "**/tests/**/*"], "references": [{"path": "../useful-types"}] } diff --git a/packages/react-cookie/CHANGELOG.md b/packages/react-cookie/CHANGELOG.md index 9f57109329..8b4dcabad8 100644 --- a/packages/react-cookie/CHANGELOG.md +++ b/packages/react-cookie/CHANGELOG.md @@ -5,7 +5,11 @@ 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 + +### Changed + +- Enable type checking in tests and fix type errors. [[#2011](https://github.com/Shopify/quilt/pull/2016)] ## 1.1.5 - 2021-08-30 diff --git a/packages/react-cookie/tsconfig.json b/packages/react-cookie/tsconfig.json index 2964d65bbe..7a3abcc811 100644 --- a/packages/react-cookie/tsconfig.json +++ b/packages/react-cookie/tsconfig.json @@ -11,6 +11,5 @@ "./src/**/*.ts", "./src/**/*.tsx" ], - "exclude": ["**/test/**/*", "**/tests/**/*"], "references": [{"path": "../react-hooks"}, {"path": "../react-network"}] } diff --git a/packages/react-csrf-universal-provider/CHANGELOG.md b/packages/react-csrf-universal-provider/CHANGELOG.md index cee68cb77b..db20ac62f5 100644 --- a/packages/react-csrf-universal-provider/CHANGELOG.md +++ b/packages/react-csrf-universal-provider/CHANGELOG.md @@ -5,7 +5,11 @@ 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 + +### Changed + +- Enable type checking in tests and fix type errors. [[#2011](https://github.com/Shopify/quilt/pull/2016)] ## 2.1.5 - 2021-08-30 diff --git a/packages/react-csrf-universal-provider/tsconfig.json b/packages/react-csrf-universal-provider/tsconfig.json index 7a70c87e1b..83715d442c 100644 --- a/packages/react-csrf-universal-provider/tsconfig.json +++ b/packages/react-csrf-universal-provider/tsconfig.json @@ -10,7 +10,6 @@ "./src/**/*.ts", "./src/**/*.tsx" ], - "exclude": ["**/test/**/*", "**/tests/**/*"], "references": [ {"path": "../react-csrf"}, {"path": "../react-effect"}, diff --git a/packages/react-csrf/CHANGELOG.md b/packages/react-csrf/CHANGELOG.md index 195e5f90d5..a504e51b28 100644 --- a/packages/react-csrf/CHANGELOG.md +++ b/packages/react-csrf/CHANGELOG.md @@ -5,7 +5,11 @@ 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 + +### Changed + +- Enable type checking in tests and fix type errors. [[#2011](https://github.com/Shopify/quilt/pull/2016)] ## 2.1.3 - 2021-08-24 diff --git a/packages/react-csrf/tsconfig.json b/packages/react-csrf/tsconfig.json index 7b3097cebc..1e336c43ca 100644 --- a/packages/react-csrf/tsconfig.json +++ b/packages/react-csrf/tsconfig.json @@ -9,6 +9,5 @@ "../../config/typescript/*.d.ts", "./src/**/*.ts", "./src/**/*.tsx" - ], - "exclude": ["**/test/**/*", "**/tests/**/*"] + ] } diff --git a/packages/react-google-analytics/CHANGELOG.md b/packages/react-google-analytics/CHANGELOG.md index 4e44b9eb3e..ed94b57665 100644 --- a/packages/react-google-analytics/CHANGELOG.md +++ b/packages/react-google-analytics/CHANGELOG.md @@ -5,7 +5,11 @@ 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 + +### Changed + +- Enable type checking in tests and fix type errors. [[#2011](https://github.com/Shopify/quilt/pull/2016)] ## 4.1.5 - 2021-08-30 diff --git a/packages/react-google-analytics/tsconfig.json b/packages/react-google-analytics/tsconfig.json index 617de02ed8..18f5b6f8d7 100644 --- a/packages/react-google-analytics/tsconfig.json +++ b/packages/react-google-analytics/tsconfig.json @@ -10,6 +10,5 @@ "./src/**/*.ts", "./src/**/*.tsx" ], - "exclude": ["**/test/**/*", "**/tests/**/*"], "references": [{"path": "../react-import-remote"}] } diff --git a/packages/react-hydrate/CHANGELOG.md b/packages/react-hydrate/CHANGELOG.md index cdbd53a36a..65fffafc67 100644 --- a/packages/react-hydrate/CHANGELOG.md +++ b/packages/react-hydrate/CHANGELOG.md @@ -5,7 +5,11 @@ 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 + +### Changed + +- Enable type checking in tests and fix type errors. [[#2011](https://github.com/Shopify/quilt/pull/2016)] ## 2.1.4 - 2021-08-30 diff --git a/packages/react-hydrate/tsconfig.json b/packages/react-hydrate/tsconfig.json index 326097fa7e..f2d81cfe02 100644 --- a/packages/react-hydrate/tsconfig.json +++ b/packages/react-hydrate/tsconfig.json @@ -10,6 +10,5 @@ "./src/**/*.ts", "./src/**/*.tsx" ], - "exclude": ["**/test/**/*", "**/tests/**/*"], "references": [{"path": "../react-effect"}, {"path": "../react-hooks"}] } diff --git a/packages/react-i18n-universal-provider/CHANGELOG.md b/packages/react-i18n-universal-provider/CHANGELOG.md index 9296bb5ae4..982368f509 100644 --- a/packages/react-i18n-universal-provider/CHANGELOG.md +++ b/packages/react-i18n-universal-provider/CHANGELOG.md @@ -5,7 +5,11 @@ 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 + +### Changed + +- Enable type checking in tests and fix type errors. [[#2011](https://github.com/Shopify/quilt/pull/2016)] ## 2.1.10 - 2021-09-03 diff --git a/packages/react-i18n-universal-provider/tsconfig.json b/packages/react-i18n-universal-provider/tsconfig.json index 9be1fc9c23..2c46d69055 100644 --- a/packages/react-i18n-universal-provider/tsconfig.json +++ b/packages/react-i18n-universal-provider/tsconfig.json @@ -10,7 +10,6 @@ "./src/**/*.ts", "./src/**/*.tsx" ], - "exclude": ["**/test/**/*", "**/tests/**/*"], "references": [ {"path": "../react-effect"}, {"path": "../react-hooks"}, diff --git a/packages/react-intersection-observer/CHANGELOG.md b/packages/react-intersection-observer/CHANGELOG.md index 96884c3830..5c6d1c881d 100644 --- a/packages/react-intersection-observer/CHANGELOG.md +++ b/packages/react-intersection-observer/CHANGELOG.md @@ -5,7 +5,11 @@ 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 + +### Changed + +- Enable type checking in tests and fix type errors. [[#2011](https://github.com/Shopify/quilt/pull/2016)] ## 3.1.3 - 2021-08-24 diff --git a/packages/react-intersection-observer/tsconfig.json b/packages/react-intersection-observer/tsconfig.json index 7b3097cebc..1e336c43ca 100644 --- a/packages/react-intersection-observer/tsconfig.json +++ b/packages/react-intersection-observer/tsconfig.json @@ -9,6 +9,5 @@ "../../config/typescript/*.d.ts", "./src/**/*.ts", "./src/**/*.tsx" - ], - "exclude": ["**/test/**/*", "**/tests/**/*"] + ] } diff --git a/packages/react-tracking-pixel/CHANGELOG.md b/packages/react-tracking-pixel/CHANGELOG.md index 03ae5778d9..2c49e5cb5a 100644 --- a/packages/react-tracking-pixel/CHANGELOG.md +++ b/packages/react-tracking-pixel/CHANGELOG.md @@ -5,7 +5,11 @@ 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 + +### Changed + +- Enable type checking in tests and fix type errors. [[#2011](https://github.com/Shopify/quilt/pull/2016)] ## 4.1.5 - 2021-08-30 diff --git a/packages/react-tracking-pixel/tsconfig.json b/packages/react-tracking-pixel/tsconfig.json index 3b21117610..7784eb9609 100644 --- a/packages/react-tracking-pixel/tsconfig.json +++ b/packages/react-tracking-pixel/tsconfig.json @@ -10,6 +10,5 @@ "./src/**/*.ts", "./src/**/*.tsx" ], - "exclude": ["**/test/**/*", "**/tests/**/*"], "references": [{"path": "../react-html"}] } diff --git a/packages/react-universal-provider/CHANGELOG.md b/packages/react-universal-provider/CHANGELOG.md index 13d7f63cfe..8bd8113514 100644 --- a/packages/react-universal-provider/CHANGELOG.md +++ b/packages/react-universal-provider/CHANGELOG.md @@ -5,7 +5,11 @@ 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 + +### Changed + +- Enable type checking in tests and fix type errors. [[#2011](https://github.com/Shopify/quilt/pull/2016)] ## 2.1.5 - 2021-08-30 diff --git a/packages/react-universal-provider/tsconfig.json b/packages/react-universal-provider/tsconfig.json index 98889b3e5c..821d89ddaf 100644 --- a/packages/react-universal-provider/tsconfig.json +++ b/packages/react-universal-provider/tsconfig.json @@ -10,6 +10,5 @@ "./src/**/*.ts", "./src/**/*.tsx" ], - "exclude": ["**/test/**/*", "**/tests/**/*"], "references": [{"path": "../react-effect"}, {"path": "../react-html"}] }