Improve type testing for older versions of TypeScript #254
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Our intent is to support TypeScript versions >= 3.1 with the types in this repository, but we don't have robust automated tests to ensure that new types we add work on older versions of TypeScript.
We have reasonably thorough tests for our types in
tests/types/index.ts
, but they only run through a single TypeScript compiler version. We have separate tests intests/versions
that run through many different TypeScript compiler versions, but they aren't thorough at all.This PR deletes the
tests/versions
types, and changes thetests/types
tests to run through many different versions of TypeScript using a script.To achieve this, I needed to split up the tests that use
// @ts-expect-error
into a separate file. This feature is only supported on TypeScript >= 3.9, so we don't run those tests on older TypeScript versions with the new set up.