ptomato / jasmine-gjs

Jasmine for GJS
MIT License
20 stars 8 forks source link

Promises and async/await never resolve #36

Closed andyholmes closed 4 years ago

andyholmes commented 4 years ago

Promises and async/await never resolve in jasmine tests. I believe this because jasmine-gjs uses a nested GMainLoop to run tests, while Promises are probably being queued in the outermost event loop.

In GJS, nested main loops will necessarily block the containing loop until g_main_loop_quit() is called, so any Promises will timeout. I'm also guessing the reason GTask async functions do work, is because they're smart enough to use the innermost loop to queue their GAsyncReadyCallback sources.

andyholmes commented 4 years ago

Sorry, I think this is totally wrong, and I'm not sure why async functions aren't resolving.