mirror of
https://github.com/logos-messaging/logos-messaging-nim.git
synced 2026-08-03 22:13:16 +00:00
making app tests sync
This commit is contained in:
parent
a9b4e654fe
commit
f524910d0f
@ -13,11 +13,11 @@ import ../testlib/wakucore, ../testlib/wakunode
|
|||||||
include waku/factory/waku, waku/common/enr/typed_record
|
include waku/factory/waku, waku/common/enr/typed_record
|
||||||
|
|
||||||
suite "Wakunode2 - Waku":
|
suite "Wakunode2 - Waku":
|
||||||
asynctest "compilation version should be reported":
|
test "compilation version should be reported":
|
||||||
## Given
|
## Given
|
||||||
let conf = defaultTestWakuConf()
|
let conf = defaultTestWakuConf()
|
||||||
|
|
||||||
let waku = (await Waku.new(conf)).valueOr:
|
let waku = (waitFor Waku.new(conf)).valueOr:
|
||||||
raiseAssert error
|
raiseAssert error
|
||||||
|
|
||||||
## When
|
## When
|
||||||
@ -28,23 +28,23 @@ suite "Wakunode2 - Waku":
|
|||||||
version == git_version
|
version == git_version
|
||||||
|
|
||||||
suite "Wakunode2 - Waku initialization":
|
suite "Wakunode2 - Waku initialization":
|
||||||
asynctest "peer persistence setup should be successfully mounted":
|
test "peer persistence setup should be successfully mounted":
|
||||||
## Given
|
## Given
|
||||||
var conf = defaultTestWakuConf()
|
var conf = defaultTestWakuConf()
|
||||||
conf.peerPersistence = true
|
conf.peerPersistence = true
|
||||||
|
|
||||||
let waku = (await Waku.new(conf)).valueOr:
|
let waku = (waitFor Waku.new(conf)).valueOr:
|
||||||
raiseAssert error
|
raiseAssert error
|
||||||
|
|
||||||
check:
|
check:
|
||||||
not waku.node.peerManager.storage.isNil()
|
not waku.node.peerManager.storage.isNil()
|
||||||
|
|
||||||
asynctest "node setup is successful with default configuration":
|
test "node setup is successful with default configuration":
|
||||||
## Given
|
## Given
|
||||||
var conf = defaultTestWakuConf()
|
var conf = defaultTestWakuConf()
|
||||||
|
|
||||||
## When
|
## When
|
||||||
var waku = (await Waku.new(conf)).valueOr:
|
var waku = (waitFor Waku.new(conf)).valueOr:
|
||||||
raiseAssert error
|
raiseAssert error
|
||||||
|
|
||||||
(waitFor startWaku(addr waku)).isOkOr:
|
(waitFor startWaku(addr waku)).isOkOr:
|
||||||
@ -62,13 +62,13 @@ suite "Wakunode2 - Waku initialization":
|
|||||||
## Cleanup
|
## Cleanup
|
||||||
waitFor waku.stop()
|
waitFor waku.stop()
|
||||||
|
|
||||||
asynctest "app properly handles dynamic port configuration":
|
test "app properly handles dynamic port configuration":
|
||||||
## Given
|
## Given
|
||||||
var conf = defaultTestWakuConf()
|
var conf = defaultTestWakuConf()
|
||||||
conf.endpointConf.p2pTcpPort = Port(0)
|
conf.endpointConf.p2pTcpPort = Port(0)
|
||||||
|
|
||||||
## When
|
## When
|
||||||
var waku = (await Waku.new(conf)).valueOr:
|
var waku = (waitFor Waku.new(conf)).valueOr:
|
||||||
raiseAssert error
|
raiseAssert error
|
||||||
|
|
||||||
(waitFor startWaku(addr waku)).isOkOr:
|
(waitFor startWaku(addr waku)).isOkOr:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user