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 Promise support #148

Open
hugoduraes opened this issue Nov 7, 2022 · 0 comments
Open

Add Promise support #148

hugoduraes opened this issue Nov 7, 2022 · 0 comments

Comments

@hugoduraes
Copy link

Describe the feature request
Add Promise support. The package methods are currently returning objects with a then property which make them look like they're returning Promises but are not. This goes against the TS type definitions which clearly indicate that the return type is a Promise!

What you are trying to do
While implementing some integration tests using Jest and MockServer client, I've found that this package doesn't support Promises when I tried to do this:

await expect(mockServerClient.verify({ ... })).resolves.toBeUndefined();

The Jest expection still passes when an error is returned by verify method because verify is not returning a Promise!

The solution you'd like
Promise support should be added, so that the above example can work. This can be achieved by wrapping the current methods with new Promise((resolve, reject) => {}) (configurable?) or by rewriting the whole package with Promises in mind.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant