jyapayne/einheit

async support

bung87 opened this issue · 2 comments

am wondering whether it's not hard add async pragma to method and prepend waitFor to all methods call

Is there a benefit to doing this? I would suggest simply calling async methods inside the test bodies.

to make the test code clean , so there's no much waitFor , just await, like asynctest does

proc someAsyncProc {.async.} =  # perform some async operations using await  
  discard
suite "test async proc":
  setup:    # invoke await in the test setup:   
    await someAsyncProc()
  teardown:    # invoke await in the test teardown:    
    await someAsyncProc()
  test "async test":    # invoke await in tests:    
    await someAsyncProc()