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

Improve TypeScript compatibility tests #581

Open
timostamm opened this issue Oct 4, 2023 · 0 comments
Open

Improve TypeScript compatibility tests #581

timostamm opened this issue Oct 4, 2023 · 0 comments
Labels
Cleanup Cleanup tasks

Comments

@timostamm
Copy link
Member

Currently, we are testing compatibility with older versions of TypeScript by compiling tests. We want to make sure that the generated code, the runtime library, and common use cases compile without issues with older versions of TypeScript.

Because our tests import from Node.js built-in packages, we need @types/node, which requires different versions for different versions of TS. This introduces complexity (e.g. #574 (comment)), but does not give us any extra confidence.

The best way forward seems to be to add a single file to packages/protobuf-test/src with common use cases, which does not import from Node.js built-in modules and does not import from @jest/globals either. Then compile it with various versions of TS for confidence.

@timostamm timostamm added the Cleanup Cleanup tasks label Oct 4, 2023
timostamm added a commit that referenced this issue Oct 25, 2023
This partially gets us to the goals defined in #581. We do not remove the dependency on `@types/node` yet, but we make sure to use the corresponding version for every version of TypeScript we test with.

To speed up GitHub actions, the compatibility tests are moved to a separate job that runs in parallel.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Cleanup Cleanup tasks
Projects
None yet
Development

No branches or pull requests

1 participant