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

Convert typings tests to tsd #1453

Merged
merged 3 commits into from
Jan 31, 2021
Merged

Conversation

shadowspawn
Copy link
Collaborator

@shadowspawn shadowspawn commented Jan 30, 2021

Pull Request

Problem

Using a TypeScript compile (tsc) to test the TypeScript typings was useful, but some minor annoyances:

  • felt a bit strange writing lots of fake code
  • declaring lots of unused variables to do return type checking
  • suppressing lint warnings from the dummy code, like the unused variables!
  • type checking by assignment is not strict

Solution

Use tsd for a fairly direct conversion to strict type tests. Instead of assigning to a typed variable, use expectType.

One related change: tsd complained about using typings property in package.json, and in fact types is more standard so changed to use that.

ChangeLog

Copy link
Collaborator

@abetomo abetomo left a comment

Choose a reason for hiding this comment

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

Cool!

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