1
0
mirror of https://github.com/waku-org/nwaku.git synced 2025-02-19 02:16:33 +00:00

21 lines
424 B
Nim
Raw Normal View History

# Sourced from: vendor/nim-libp2p/tests/testutils.nim
# Adds the ability for asyncSetup and asyncTeardown to be used in unittest2
template asyncTeardown*(body: untyped): untyped =
teardown:
waitFor(
(
proc() {.async, gcsafe.} =
body
)()
)
template asyncSetup*(body: untyped): untyped =
setup:
waitFor(
(
proc() {.async, gcsafe.} =
body
)()
)