@@ -50,7 +50,7 @@ import AgentTests.FunctionalAPITests (rfGet, runRight, runRight_, sfGet, withAge
5050import Simplex.Messaging.Agent (AgentClient , xftpReceiveFile , xftpSendFile , xftpStartWorkers )
5151import Simplex.Messaging.Agent.Protocol (AEvent (.. ))
5252import SMPAgentClient (agentCfg , initAgentServers , testDB )
53- import XFTPCLI (recipientFiles , senderFiles )
53+ import XFTPCLI (recipientFiles , senderFiles , testBracket )
5454import qualified Simplex.Messaging.Crypto.File as CF
5555
5656xftpWebDir :: FilePath
@@ -167,8 +167,8 @@ impAddr = "import * as Addr from './dist/protocol/address.js';"
167167jsOut :: String -> String
168168jsOut expr = " process.stdout.write(Buffer.from(" <> expr <> " ));"
169169
170- xftpWebTests :: Spec
171- xftpWebTests = do
170+ xftpWebTests :: IO () -> Spec
171+ xftpWebTests dbCleanup = do
172172 distExists <- runIO $ doesDirectoryExist (xftpWebDir <> " /dist" )
173173 if distExists
174174 then do
@@ -187,7 +187,7 @@ xftpWebTests = do
187187 tsClientTests
188188 tsDownloadTests
189189 tsAddressTests
190- tsIntegrationTests
190+ tsIntegrationTests dbCleanup
191191 else
192192 it " skipped (run 'cd xftp-web && npm install && npm run build' first)" $
193193 pendingWith " TS project not compiled"
@@ -2829,8 +2829,9 @@ tsAddressTests = describe "protocol/address" $ do
28292829
28302830-- ── integration ───────────────────────────────────────────────────
28312831
2832- tsIntegrationTests :: Spec
2833- tsIntegrationTests = describe " integration" $ do
2832+ tsIntegrationTests :: IO () -> Spec
2833+ tsIntegrationTests dbCleanup = describe " integration" $
2834+ around_ testBracket . after_ dbCleanup $ do
28342835 it " web handshake with Ed25519 identity verification" $
28352836 webHandshakeTest testXFTPServerConfigEd25519SNI " tests/fixtures/ed25519/ca.crt"
28362837 it " web handshake with Ed448 identity verification" $
0 commit comments