felixge / felixge/node-gently

Add an option to disable order checking

Ouverte
#26 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
JavaScript
Étoiles
141
Forks
15
Métriques de merge des PR
Aucune PR mergée en 30 j

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?

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.