Skip to content

Add an option to disable order checking #26

@aduh95

Description

@aduh95

Sometimes we want a function to be called before the process exits, but we don't care if other calls happen until then. The use case I have in mind is catching Promises that never settles. What I would like to write is:

async function testFn() {
  gently.expect(someObject, 'someMethod')
  await someObject.testedMethod()
}

asyncFn().then(gently.expect(1, function callAfterThen() {});

If I try that, I'll get Error: Unexpected call to [SomeClass].someMethod(), expected call to callAfterThen().

Could we get an option to disable order checking? Or another method gently.expectEventually maybe?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions