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

Enable/fix test typing in multiple packages #2016

Merged
merged 19 commits into from
Sep 10, 2021
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
0699111
enable/fix test type checking for /react-app-bridge-universal-provider
peter-hamilton Aug 27, 2021
1df9364
enable/fix test type checking for /react-compose
peter-hamilton Aug 27, 2021
1ab61b8
enable/fix test type checking for /react-cookie
peter-hamilton Aug 27, 2021
bd2284a
enable/fix test type checking for /react-csrf
peter-hamilton Aug 27, 2021
3232e3d
enable/fix test type checking for /react-csrf-universal-provider
peter-hamilton Aug 27, 2021
278dc87
enable/fix test type checking for /react-google-analytics
peter-hamilton Aug 27, 2021
0a06bd2
enable/fix test type checking for /react-hydrate
peter-hamilton Aug 27, 2021
c90d80d
enable/fix test type checking for /react-i18n-universal-provider
peter-hamilton Aug 27, 2021
8fa0c2a
enable/fix test type checking for /react-intersection-observer
peter-hamilton Aug 27, 2021
88e0b55
enable/fix test type checking for /react-tracking-pixel
peter-hamilton Aug 27, 2021
ea5a0df
enable/fix test type checking for /react-univeral-provider
peter-hamilton Aug 27, 2021
0dd2956
update changelog
peter-hamilton Aug 27, 2021
5b756c2
Merge branch 'main' into test-typing-import-matchers
peter-hamilton Aug 27, 2021
1e481e1
fix changelog typo
peter-hamilton Aug 27, 2021
092f57a
Merge branch 'test-typing-import-matchers' of https://github.com/shop…
peter-hamilton Aug 27, 2021
8e02ca8
Merge branch 'main' into test-typing-import-matchers
peter-hamilton Aug 30, 2021
81b16c4
Replace setup.ts files with a d.ts reference.
peter-hamilton Sep 9, 2021
7f05c29
Merge branch 'main' into test-typing-import-matchers
atesgoral Sep 10, 2021
4c12ed6
Merge branch 'main' into test-typing-import-matchers
atesgoral Sep 10, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.9 - 2021-08-30

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"}]
}