-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Migrate type tests to TSTyche #1988
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
dist | ||
pages/generated | ||
pages/out | ||
type-definitions/ts-tests/ | ||
type-definitions/flow-tests/ | ||
type-definitions/ts-tests/*.ts | ||
type-definitions/flow-tests/ | ||
|
||
!type-definitions/ts-tests/covariance.ts | ||
!type-definitions/ts-tests/deepCopy.ts | ||
!type-definitions/ts-tests/empty.ts | ||
!type-definitions/ts-tests/es6-collections.ts |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,7 +55,9 @@ | |
"npm": ">=7.0.0" | ||
}, | ||
"scripts": { | ||
"test": "run-s format lint type-check build unit-test", | ||
"test": "run-s format lint type-check build test:*", | ||
"test:unit": "jest", | ||
"test:types": "tstyche", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added Currently There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually, we do have this file telling that the minimum version is 4.5, and I think that we do only test 4.5 (not really sure about that, we might use the local typescript version). It might be interesting to test multiple typescript version in CI (but not done actually, so if it can be do, it's great, but not a necessity). Locally, I think that testing the local version of typescript is good enough. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right. I forgot to mention that |
||
"format": "npm run lint:format -- --write", | ||
"lint": "run-s lint:*", | ||
"lint:format": "prettier --check \"{__tests__,src,type-definitions,website/src,perf,resources}/**/*{.js,.ts,.tsx,.flow,.css}\"", | ||
|
@@ -69,7 +71,6 @@ | |
"build:types": "cpy ./type-definitions/immutable.* dist", | ||
"build:prepare": "./resources/prepare-dist.sh", | ||
"build:stats": "node ./resources/dist-stats.mjs", | ||
"unit-test": "jest", | ||
"website:build": "cd website && next build && next-sitemap", | ||
"website:dev": "cd website && next dev", | ||
"check-git-clean": "./resources/check-git-clean.sh", | ||
|
@@ -127,6 +128,7 @@ | |
"rollup": "3.28.1", | ||
"size-limit": "^8.2.6", | ||
"transducers-js": "0.4.174", | ||
"tstyche": "^1.0.0", | ||
"typescript": "5.1" | ||
}, | ||
"size-limit": [ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"$schema": "https://tstyche.org/schemas/config.json", | ||
"testFileMatch": [ | ||
"**/type-definitions/ts-tests/covariance.ts", | ||
"**/type-definitions/ts-tests/deepCopy.ts", | ||
"**/type-definitions/ts-tests/empty.ts", | ||
"**/type-definitions/ts-tests/es6-collections.ts" | ||
] | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jdeniau What you think? Locally
test:types
would test only on the installed TypeScript. The lowest supported version (4.5
, resolves to4.5.5
) is checked on CI. I would definitely recommend adding5.0
(resolves to5.0.2
), because each major brings in breaking changes. And currently installed.latest
could be added. It points totypescript@latest
in NPM registry, hence it is a changing target. It might start failing with any unrelated PR, i.e. even without changes in types. That’s somewhat unpredictable.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
latest
(or evennext
) could work as a daily cron job. Just some food for though.