Eric Mastro c4b23d73a9 feat: add support for suite before and after
`before` executes async code before all tests in the suite.
`after` executes async code after all tests in the suite.
2022-03-01 07:22:46 +01:00

32 lines
650 B
Nim

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()
suite "test async setupAll and teardownAll, allow multiple suites":
setupAll:
# invoke await in the test setup:
await someAsyncProc()
teardownAll:
# invoke await in the test teardown:
await someAsyncProc()
test "async test":
# invoke await in tests:
await someAsyncProc()