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

Server class in index.d.ts does not match Pretender class #337

Open
katehedgpeth opened this issue Oct 24, 2021 · 1 comment · May be fixed by #353
Open

Server class in index.d.ts does not match Pretender class #337

katehedgpeth opened this issue Oct 24, 2021 · 1 comment · May be fixed by #353

Comments

@katehedgpeth
Copy link

katehedgpeth commented Oct 24, 2021

The Server class defined in index.d.ts does not seem to match the Pretender class in ./src/pretender.ts that it is supposed to represent. It is missing the handledRequests, passthroughRequests, and unhandledRequests properties. There may be more missing types, as I haven't examined every prop closely.

It seems to me that instead of having a separate type definition file that has to stay in sync with the class, it would be better to export the types from the class directly with rollup.

I have a PR ready to go that implements this fix. I'll post it in a few minutes and reference this issue.

@AndrewOttavianoAbb
Copy link

AndrewOttavianoAbb commented Apr 4, 2022

@katehedgpeth I found the same issue as well! I would like to access this.handledRequests for my jest test, but TS is blowing up in my face because the property is not defined on that type. 😢

@xg-wang
@trek
@stefanpenner
@rwjblue

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 a pull request may close this issue.

2 participants