felixge / felixge/node-gently

Add an option to disable order checking

オープン
#26 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
JavaScript
スター
141
フォーク
15
PR マージ指標
30日以内にマージされた PR はありません

説明

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?

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。