Skip to content
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

[chore]: use TSTyche for type testing #2901

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

mrazauskas
Copy link

@mrazauskas mrazauskas commented Sep 9, 2024

Closes #2900

Implementation details

TSTyche is installed and used for type testing.

Tests

  • Current tests are passing.

Documentation
N/A

Comment on lines -2975 to -2976
"node_modules/@tsd/typescript": {
"version": "4.8.4",
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This means [email protected] is currently used to test types. But the installed version of TypeScript is 5.4.5.

Hm.. Is this intentional? TSTyche can test agains specific version, e.g. tstyche --target 4.8. This command would use the latest version in 4.8 series (4.8.4). Or simply: tstyche --target 4.8.4.

@@ -94,6 +95,6 @@
"test-redis-socket": "mocha packages/controller/test/redis-socket/*.ts --exit",
"test-redis-sentinel": "mocha packages/controller/test/redis-sentinel/*.ts --exit",
"test-types-check": "tsc --project packages/controller/tsconfig.check.json",
"test-types": "npm run test-types-check && npm run test --workspace=@iobroker/types"
"test-types": "npm run test-types-check && tstyche packages/types-public/typetest/*.tst.ts"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to the above: "test": "mocha packages/controller/test/*.ts --exit"

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved to packages/types-public/typetest directory, that is named similar to packages/controller/test.

Also renaming this file, because **/*.tst.* is the default test file pattern of TSTyche. It is possible to select **/*.test-d.ts files as well, but that would require adding tstyche.config.json.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[enhancement]: Migrate type test to TSTyche
1 participant