Skip to content

Proposal: Add async API #21

@Sayan751

Description

@Sayan751

Currently, the API is exclusively synchronous. An asynchronous API would be easier when waiting for a particular state in tests.

  • await spy.isCalledAsync(methodName, [count], [timeout]);
  • await spy.isCalledWithAsync(methodName, argList, [options]);
    • argList can be either [arg_1, ..., arg_n] for a single call or [[arg_1_1, ..., arg_1_n], ..., [arg_m_1, ..., arg_m_n]] for multiple calls.
    • options can have the following properties:
      • orderInsensitive: when set to true then the order of the argList does not matter.
      • isSet: when set to true, then the argList is considered as a set.
      • index: when set, then the argList is matched against a particular invocation of the method, indicated by the given index.
      • timeout: if the assertion fails, when it cannot be resolved under the given timeout.

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