1

I'm getting started with writing JS unit tests in the Truffle framework. I'm curious to learn when to use promises over async? On the surface, async seems a lot cleaner and easier to use for testing purposes.

3
  • 1
    I’m not sure I understand your question. async/await is just syntactic sugar to work with Promises. – Adam Kipnis Mar 30 '18 at 2:49
  • It is a personal/technical preference. If you already have lots of code using promises switching to async/await might not be worth of the effort. . – Ismael Mar 30 '18 at 4:38
  • Also, await/async are not available is some environement such as google functions. So you have to use promise. As @Ismael said, it demends on you and on your environment – Florian Castelain Mar 30 '18 at 12:50

Browse other questions tagged or ask your own question.