Skip to content

Add Promise support #148

@hugoduraes

Description

@hugoduraes

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions