nim-chat-poc/tests/smoke_test.nim
Patryk Osmaczko 66bf357a73
chore: add smoke test and redesign CI workflow
Add a smoke test that validates the binary links all dependencies
at runtime by instantiating a client without networking. Redesign
CI into separate build and test jobs, with test gated on build.
2026-02-13 20:28:22 +01:00

22 lines
633 B
Nim

# Smoke test: validates that the binary links all dependencies at runtime.
# No networking, no start(), no message exchange — just instantiation.
import ../src/chat
proc main() =
try:
let waku = initWakuClient(DefaultConfig())
let ident = createIdentity("SmokeTest")
var client = newClient(waku, ident)
if client.isNil:
raise newException(CatchableError, "newClient returned nil")
let id = client.getId()
echo "smoke_test: OK (client id: " & id & ")"
quit(QuitSuccess)
except CatchableError as e:
echo "smoke_test: FAILED — " & e.msg
quit(QuitFailure)
when isMainModule:
main()