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

Commit

Permalink
Merge pull request #2016 from Shopify/test-typing-import-matchers
Browse files Browse the repository at this point in the history
Enable/fix test typing in multiple packages
  • Loading branch information
peter-hamilton authored Sep 10, 2021
2 parents 168986a + 4c12ed6 commit f96703c
Show file tree
Hide file tree
Showing 23 changed files with 87 additions and 24 deletions.
30 changes: 30 additions & 0 deletions config/typescript/matchers.d.ts
Original file line number Diff line number Diff line change
@@ -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> = T extends Node<infer U> ? U : never;
declare global {
// eslint-disable-next-line @typescript-eslint/no-namespace
namespace jest {
interface Matchers<R, T = {}> {
toHaveReactProps(props: Partial<PropsFromNode<T>>): void;
toHaveReactDataProps(data: {[key: string]: string}): void;
toContainReactComponent<Type extends string | ComponentType<any>>(
type: Type,
props?: Partial<PropsFor<Type>>,
): void;
toContainReactComponentTimes<Type extends string | ComponentType<any>>(
type: Type,
times: number,
props?: Partial<PropsFor<Type>>,
): void;
toProvideReactContext<Type>(
context: ReactContext<Type>,
value?: Type,
): void;
toContainReactText(text: string): void;
toContainReactHtml(text: string): void;
}
}
}
6 changes: 5 additions & 1 deletion packages/react-app-bridge-universal-provider/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 -->
## 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

Expand Down
1 change: 0 additions & 1 deletion packages/react-app-bridge-universal-provider/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,5 @@
"./src/**/*.ts",
"./src/**/*.tsx"
],
"exclude": ["**/test/**/*", "**/tests/**/*"],
"references": [{"path": "../react-html"}]
}
6 changes: 5 additions & 1 deletion packages/react-compose/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 -->
## 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

Expand Down
1 change: 0 additions & 1 deletion packages/react-compose/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,5 @@
"./src/**/*.ts",
"./src/**/*.tsx"
],
"exclude": ["**/test/**/*", "**/tests/**/*"],
"references": [{"path": "../useful-types"}]
}
6 changes: 5 additions & 1 deletion packages/react-cookie/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 -->
## 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

Expand Down
1 change: 0 additions & 1 deletion packages/react-cookie/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,5 @@
"./src/**/*.ts",
"./src/**/*.tsx"
],
"exclude": ["**/test/**/*", "**/tests/**/*"],
"references": [{"path": "../react-hooks"}, {"path": "../react-network"}]
}
6 changes: 5 additions & 1 deletion packages/react-csrf-universal-provider/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 -->
## 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

Expand Down
1 change: 0 additions & 1 deletion packages/react-csrf-universal-provider/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"./src/**/*.ts",
"./src/**/*.tsx"
],
"exclude": ["**/test/**/*", "**/tests/**/*"],
"references": [
{"path": "../react-csrf"},
{"path": "../react-effect"},
Expand Down
6 changes: 5 additions & 1 deletion packages/react-csrf/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 -->
## 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

Expand Down
3 changes: 1 addition & 2 deletions packages/react-csrf/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,5 @@
"../../config/typescript/*.d.ts",
"./src/**/*.ts",
"./src/**/*.tsx"
],
"exclude": ["**/test/**/*", "**/tests/**/*"]
]
}
6 changes: 5 additions & 1 deletion packages/react-google-analytics/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 -->
## 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

Expand Down
1 change: 0 additions & 1 deletion packages/react-google-analytics/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,5 @@
"./src/**/*.ts",
"./src/**/*.tsx"
],
"exclude": ["**/test/**/*", "**/tests/**/*"],
"references": [{"path": "../react-import-remote"}]
}
6 changes: 5 additions & 1 deletion packages/react-hydrate/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 -->
## 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

Expand Down
1 change: 0 additions & 1 deletion packages/react-hydrate/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,5 @@
"./src/**/*.ts",
"./src/**/*.tsx"
],
"exclude": ["**/test/**/*", "**/tests/**/*"],
"references": [{"path": "../react-effect"}, {"path": "../react-hooks"}]
}
6 changes: 5 additions & 1 deletion packages/react-i18n-universal-provider/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 -->
## 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

Expand Down
1 change: 0 additions & 1 deletion packages/react-i18n-universal-provider/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"./src/**/*.ts",
"./src/**/*.tsx"
],
"exclude": ["**/test/**/*", "**/tests/**/*"],
"references": [
{"path": "../react-effect"},
{"path": "../react-hooks"},
Expand Down
6 changes: 5 additions & 1 deletion packages/react-intersection-observer/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 -->
## 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

Expand Down
3 changes: 1 addition & 2 deletions packages/react-intersection-observer/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,5 @@
"../../config/typescript/*.d.ts",
"./src/**/*.ts",
"./src/**/*.tsx"
],
"exclude": ["**/test/**/*", "**/tests/**/*"]
]
}
6 changes: 5 additions & 1 deletion packages/react-tracking-pixel/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 -->
## 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

Expand Down
1 change: 0 additions & 1 deletion packages/react-tracking-pixel/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,5 @@
"./src/**/*.ts",
"./src/**/*.tsx"
],
"exclude": ["**/test/**/*", "**/tests/**/*"],
"references": [{"path": "../react-html"}]
}
6 changes: 5 additions & 1 deletion packages/react-universal-provider/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 -->
## 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

Expand Down
1 change: 0 additions & 1 deletion packages/react-universal-provider/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,5 @@
"./src/**/*.ts",
"./src/**/*.tsx"
],
"exclude": ["**/test/**/*", "**/tests/**/*"],
"references": [{"path": "../react-effect"}, {"path": "../react-html"}]
}

0 comments on commit f96703c

Please sign in to comment.