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

Add tests for type definitions #4134

Closed
remcohaszing opened this issue Oct 4, 2021 · 5 comments
Closed

Add tests for type definitions #4134

remcohaszing opened this issue Oct 4, 2021 · 5 comments

Comments

@remcohaszing
Copy link
Contributor

Is your feature request related to a problem? Please describe.

Currently there are not automated tests for axios type definitions. This has lead to breakage in the past, and is likely to cause issues in the future. Also the axios team seems to be hesitant to merge type enhancements, because they don’t have a lot of experience with TypeScript themselves (as far as I could tell).

Describe the solution you'd like

I would like to add automated tests using dtslint. This is the same tool to test types that is used by DefinitelyTyped. An example of what this would look like can be found in JedWatson/classnames#251.

Describe alternatives you've considered

N/A

Additional context

The latest (0.22.0) axios types are broken at the moment of writing.

@imransilvake
Copy link

imransilvake commented Oct 4, 2021

I am getting the following typescript error on 0.22.0:
Screenshot 2021-10-04 at 12 26 31
Screenshot 2021-10-04 at 12 26 36

is there a fix for this issue?

before, the header type was:

export interface AxiosRequestConfig {
  headers?: any;
}  

@udebella
Copy link

udebella commented Oct 4, 2021

@imransilvake your issue seems to match #4108

@matushorvath
Copy link

@imransilvake your issue seems to match #4108

I believe this issue was created as a request to add tests that will prevent similar problems in future, rather than to fix this particular problem. I would second that request, we also found today that our production code that compiles and works with axios 0.21 suddenly contains lots of type errors when compiling against axios 0.22. Adding tests to catch similar issues before a release would be a significant quality improvement for people who use TypeScript.

@remcohaszing
Copy link
Contributor Author

I’m willing to set this up if an axios member agrees.

@jasonsaayman
Copy link
Member

@remcohaszing please go ahead, more testing is almost always welcomed

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

No branches or pull requests

5 participants