felixge / felixge/node-gently

Add an option to disable order checking

未关闭
#26 1 条评论 0 个 reaction 已指派 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 摘要。