Skip to content

chore: migrate type tests to TSTyche #782

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

Closed
wants to merge 2 commits into from

Conversation

mrazauskas
Copy link

Jira: https://jira.mongodb.org/browse/EAI-

Changes

This PR migrates type test to TSTyche.

Notes

jest-tsd was added recently to this repo. It depends on tsd-lite that is deprecated for long time. I was maintaining tsd-lite and I would recommend using TSTyche instead. This is my new project written from scratch. TSTyche solves many issues and shortcomings of tsd architecture.

For instance:

  • it has test() and describe() with .only and .skip;
  • expect style assertions that read just like any other test in this repo;
  • assertions like .toHaveProperty() or .toBeCallableWith(), you don’t have to expect errors anymore;
  • it can test agains specified version of TypeScript or a range of versions: tstyche --target '>=5.0 <5.3';
  • the install size is only 250kB, because it will load the installed typescript;
  • and so on.

Check out the documentation: https://tstyche.org

@@ -32,7 +32,6 @@
"./mongodb": "./build/mongodb.js",
"./mongoDbMetadata": "./build/mongoDbMetadata/index.js",
"./openai": "./build/openai.js",
"./aiSdk": "./build/aiSdk.js",
Copy link
Author

Choose a reason for hiding this comment

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

Was removed by npm as duplicate. Already defined above (line 30).

@@ -14,6 +14,7 @@
"clean": "lerna clean",
"build": "lerna run build",
"test": "lerna run test",
"test:types": "lerna run test:types",
Copy link
Author

@mrazauskas mrazauskas Jun 20, 2025

Choose a reason for hiding this comment

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

I would recommend keeping test:types as a separate script instead of sandwiching it with test. Similar how lint is used.

So you can pass additional flags easily: npm run test:types -- -- --target next. This command runs type tests agains typescript@next.

@mongodben
Copy link
Collaborator

thank you for proposing this PR but currently we're not taking external contributions. closing.

@mongodben mongodben closed this Jul 2, 2025
@mrazauskas mrazauskas deleted the migrate-to-tstyche branch July 3, 2025 03:55
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.

2 participants