sinonjs/sinon

Document how we can control Promises

Open

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

在 GitHub 查看
 (8 评论) (0 反应) (0 负责人)JavaScript (9,548 star) (764 fork)batch import
DocumentationHelp wantedgood first issuehacktoberfestpinned

描述

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 ...

贡献者指南