sinonjs/sinon

Document how we can control Promises

开放

#1,898 创建于 2018年9月9日

 (8 条评论) (0 个反应) (0 位负责人)JavaScript (764 个派生)batch import
DocumentationHelp wantedgood first issuehacktoberfestpinned

仓库指标

星标
 (9,548 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

There have been a couple of longstanding issues and pull requests regarding Promises on the lolex issue tracker.

I am assuming we will probably implement https://github.com/sinonjs/lolex/issues/114 in time, for a totally synchronous way to control Promises, but for it to work fully in true ES2017+ environments using asynchronous/await it requires explicit support from the underlying engine.

Before it's implemented we should document for people how they can control Promises today in "normal" cases. We can't cover all cases (as mentioned above), but we could perhaps make a tutorial to show a possible path. I don't care about pretty in this regard, but results, so if it involves overriding Promise.prototype, installing Bluebird or other non-core Sinon libs that's ok. It's just about covering how to achieve a common desire, like the proxyquire article shows.

I am not totally sure how or what, but something ...

贡献者指南