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

stubInterface is not returning promise #254

Open
jose-roberto-abreu opened this issue Apr 1, 2022 · 0 comments
Open

stubInterface is not returning promise #254

jose-roberto-abreu opened this issue Apr 1, 2022 · 0 comments

Comments

@jose-roberto-abreu
Copy link

Hello everyone,

I need your help checking what's happening with the following test:

it("on successful creation delivers created service", async function() {
        let anyService = new Service(...)
        let serviceRepositorySpy = stubInterface<IServicesRepository>({createService: Promise.resolve(anyService)})
        let createServiceUseCase = new CreateServiceUseCase(serviceRepositorySpy);
        
        await expect(createServiceUseCase.createService(...)).to.eventually.eql(anyService)
    });

But looks like the promise that I stubbed is not getting returned, but rather is returning undefined.

Is there anything missing?
Does stubInterface allow stubbing responses or should only be used to check the call count (because checking the call count is working fine for me)?

Thanks, this is great library!

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

1 participant