protobuf-es
protobuf-es copied to clipboard
Improve TypeScript compatibility tests
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. https://github.com/bufbuild/protobuf-es/pull/574#issuecomment-1747345724), 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.