Skip to content
This repository was archived by the owner on Aug 24, 2023. It is now read-only.
This repository was archived by the owner on Aug 24, 2023. It is now read-only.

Using Promise.all() with mock-inspect to the same endpoint - response is always the same #66

@thomaschaplin

Description

@thomaschaplin

Below is a question which I felt suitable to be added to the issues so we can track this and keep a log of the response in case anyone comes across the same question.

Question:

So, I've got some code that makes a number of api calls to the same endpoint with different request bodies concurrently in a Promise.all(). I'm writing tests for this code, mocking the responses with mock-inspect . What I found is that one mockRequest({...}) mocks all of the calls made within the Promise.all and the mocked response is the same for all calls. Is this expected behaviour? I would have assumed it to be possible to mock each of the api calls separately

Metadata

Metadata

Assignees

Labels

questionFurther information is requested

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions