Async await
jbadeau opened this issue · 3 comments
Hello again,
In order to unify a/sync code I am considering using something like:
https://github.com/electronicarts/ea-async
https://github.com/vipcxj/jasync
Basically methods would return promises.
Any thoughts on this?
Jose
Hey Jose,
this looks like a good idea. I'm not sure if I want to return promises, though.
I think in most test scenarios I want to wait for things anyway. In theory, I can do things while I wait, but those are rare in my experience. Returning such objects might be confusing for people not used to this type of programming.
On the other hand leaving the decision to the caller is certainly a good idea… maybe we could add two variants?
I have to think about it. If you can spare the time to create a PR, feel free. I think seeing the resulting code would help to reach a decision here.
Thanks,
Micha
Thinking some more about this, we could change the *Eventually methods to return promises, and put the current blocking logic into overloaded versions of checks and does.
Hi, Happy new year!
So maybe a little context would help:
I have seen that plawrite has an async api and I was thinking if this would make sense in screenplay.
After a bit of thought I realized that its prob not worth it as most test framework dont support async anyway and it will make the api harder to understand.
For me its fine to close this topic