sinonjs/sinon

Document how we can control Promises

Open

#1 898 ouverte le 9 sept. 2018

Voir sur GitHub
 (8 commentaires) (0 réactions) (0 assignés)JavaScript (764 forks)batch import
DocumentationHelp wantedgood first issuehacktoberfestpinned

Métriques du dépôt

Stars
 (9 548 stars)
Métriques de merge PR
 (Merge moyen 6j 16h) (15 PRs mergées en 30 j)

Description

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

Guide contributeur