mirror of https://github.com/waku-org/nwaku.git
17 lines
388 B
Nim
17 lines
388 B
Nim
|
# 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
|
||
|
)())
|