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

Add an option to disable order checking #26

Open
aduh95 opened this issue Jul 28, 2021 · 1 comment
Open

Add an option to disable order checking #26

aduh95 opened this issue Jul 28, 2021 · 1 comment

Comments

@aduh95
Copy link

aduh95 commented Jul 28, 2021

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?

@kvz
Copy link
Collaborator

kvz commented Jul 28, 2021

Felix is not actively maintaining this but if Transloadians all agree I think we can get it merged, I don’t think there is a lot of adoption outside of TL.

You could also consider rewriting the test in Jest, which is were we’re are gradually trying to head

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

2 participants