felixge / felixge/node-gently

Add an option to disable order checking

Aperta
#26 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
JavaScript
Stelle
141
Fork
15
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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?

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.