From 34e274d45ee5fd27eca983979bbc4b04add59109 Mon Sep 17 00:00:00 2001 From: InversionSpaces Date: Tue, 16 Jan 2024 11:19:09 +0100 Subject: [PATCH] chore(tests): Remove usage of `onConnectionStateChange` [LNG-291] (#1046) Remove usage of onConnectionStateChange --- .../src/__test__/examples.spec.ts | 34 ++++++------------- 1 file changed, 11 insertions(+), 23 deletions(-) diff --git a/integration-tests/src/__test__/examples.spec.ts b/integration-tests/src/__test__/examples.spec.ts index 40d911d8..dce66e92 100644 --- a/integration-tests/src/__test__/examples.spec.ts +++ b/integration-tests/src/__test__/examples.spec.ts @@ -40,9 +40,7 @@ import { multipleAbilityWithClosureCall, returnSrvAsAbilityCall, } from "../examples/abilityCall.js"; -import { - bugLNG314Call, -} from "../examples/abilityClosureCall.js"; +import { bugLNG314Call } from "../examples/abilityClosureCall.js"; import { nilLengthCall, nilLiteralCall, @@ -123,7 +121,7 @@ import { lng193BugCall } from "../examples/closureReturnRename.js"; import { closuresCall, multipleClosuresLNG262BugCall, - lng317BugCall + lng317BugCall, } from "../examples/closures.js"; import { closureArrowCaptureCall } from "../examples/closureArrowCapture.js"; import { @@ -185,22 +183,12 @@ import log from "loglevel"; // log.setDefaultLevel("debug") async function start() { - console.log("CONNECTING TO FIRST:"); - Fluence.onConnectionStateChange((s) => { - console.log(s); - }); await Fluence.connect(relay1, {}); - const cl = await Fluence.getClient(); - peer1 = cl; - selfPeerId = cl.getPeerId(); - console.log("CONNECTED"); - peer2 = await createClient(relay2, {}); - console.log("CONNECTING TO SECOND:"); - peer2.onConnectionStateChange((s) => { - console.log(s); - }); - console.log("CONNECTED"); + peer1 = Fluence.getClient(); + selfPeerId = peer1.getPeerId(); + + peer2 = await createClient(relay2); } async function stop() { @@ -671,9 +659,9 @@ describe("Testing examples", () => { }); it("abilitiesClosure.aqua bug LNG-314", async () => { - let result = await bugLNG314Call(); - expect(result).toEqual("strstrstr"); - }); + let result = await bugLNG314Call(); + expect(result).toEqual("strstrstr"); + }); it("functors.aqua LNG-119 bug", async () => { let result = await bugLng119Call(); @@ -1114,8 +1102,8 @@ describe("Testing examples", () => { }); it("closures.aqua bug LNG-317", async () => { - let result = await lng317BugCall(); - expect(result).toEqual(["empty", "identity"]); + let result = await lng317BugCall(); + expect(result).toEqual(["empty", "identity"]); }); it("closureArrowCapture.aqua", async () => {