Do settled promise chain handlers fire in the same turn?

T.J. Crowder tj.crowder at
Sun Feb 26 19:54:20 UTC 2017

On Sun, Feb 26, 2017 at 7:49 PM, /#!/JoePea <joe at> wrote:
> Thanks T.J., that explains it well.

Glad that helped!

> I asked because I'm working with synchronous tests, so I'm wondering
> how to resolve ES6 Promises with fake network data synchronously,
> and fire all the handlers synchronously, all within the synchronous
> test function.
> Any recommendation on that?

Only way I know is to use an *asynchronous* test function instead.
Mocha, Jasmine, etc., all have handling for asynchronous tests.

-- T.J.

More information about the es-discuss mailing list