Skip to content

Being able to ensure synchrony between http requestsΒ #106

@SalvaCarsi

Description

@SalvaCarsi

✨ Feature proposal

Being able to ensure synchrony between http requests. As a user of Wrapito I would like to ensure that a request its being called after a previous one is finished.

🎯 Motivation

I have this use case where I want to create an entity with a POST request. And then I want to retrieve a list with all the entities I have, including the last addition.

With this feature I want to make sure that the retrieval of the list doesn't start until the creation is done.

This will throw an error if, for example, we don't await the resolution of the entity creation and fetch right away the list of all entities.

πŸ‘€ Example

I was thinking about something like

expect('/managers/').toHaveBeenFetchedWith({
    ...
    dependsOn: {
      path: '/managers/',
      method: 'POST',
      body: {
        name: 'John'
      },
    },
  })

πŸ’¬ Comments

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions