felixge / felixge/node-gently

Add an option to disable order checking

Open
#26 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
141
Forks
15
PR merge metrics
No merged PRs in 30d

Description

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 `Promise`s that never settles. What I would like to write is:

```js
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?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.