chore(tests): Remove usage of onConnectionStateChange [LNG-291] (#1046)

Remove usage of onConnectionStateChange
This commit is contained in:
InversionSpaces 2024-01-16 11:19:09 +01:00 committed by GitHub
parent 098fac79ba
commit 34e274d45e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -40,9 +40,7 @@ import {
multipleAbilityWithClosureCall, multipleAbilityWithClosureCall,
returnSrvAsAbilityCall, returnSrvAsAbilityCall,
} from "../examples/abilityCall.js"; } from "../examples/abilityCall.js";
import { import { bugLNG314Call } from "../examples/abilityClosureCall.js";
bugLNG314Call,
} from "../examples/abilityClosureCall.js";
import { import {
nilLengthCall, nilLengthCall,
nilLiteralCall, nilLiteralCall,
@ -123,7 +121,7 @@ import { lng193BugCall } from "../examples/closureReturnRename.js";
import { import {
closuresCall, closuresCall,
multipleClosuresLNG262BugCall, multipleClosuresLNG262BugCall,
lng317BugCall lng317BugCall,
} from "../examples/closures.js"; } from "../examples/closures.js";
import { closureArrowCaptureCall } from "../examples/closureArrowCapture.js"; import { closureArrowCaptureCall } from "../examples/closureArrowCapture.js";
import { import {
@ -185,22 +183,12 @@ import log from "loglevel";
// log.setDefaultLevel("debug") // log.setDefaultLevel("debug")
async function start() { async function start() {
console.log("CONNECTING TO FIRST:");
Fluence.onConnectionStateChange((s) => {
console.log(s);
});
await Fluence.connect(relay1, {}); await Fluence.connect(relay1, {});
const cl = await Fluence.getClient();
peer1 = cl;
selfPeerId = cl.getPeerId();
console.log("CONNECTED");
peer2 = await createClient(relay2, {}); peer1 = Fluence.getClient();
console.log("CONNECTING TO SECOND:"); selfPeerId = peer1.getPeerId();
peer2.onConnectionStateChange((s) => {
console.log(s); peer2 = await createClient(relay2);
});
console.log("CONNECTED");
} }
async function stop() { async function stop() {
@ -671,9 +659,9 @@ describe("Testing examples", () => {
}); });
it("abilitiesClosure.aqua bug LNG-314", async () => { it("abilitiesClosure.aqua bug LNG-314", async () => {
let result = await bugLNG314Call(); let result = await bugLNG314Call();
expect(result).toEqual("strstrstr"); expect(result).toEqual("strstrstr");
}); });
it("functors.aqua LNG-119 bug", async () => { it("functors.aqua LNG-119 bug", async () => {
let result = await bugLng119Call(); let result = await bugLng119Call();
@ -1114,8 +1102,8 @@ describe("Testing examples", () => {
}); });
it("closures.aqua bug LNG-317", async () => { it("closures.aqua bug LNG-317", async () => {
let result = await lng317BugCall(); let result = await lng317BugCall();
expect(result).toEqual(["empty", "identity"]); expect(result).toEqual(["empty", "identity"]);
}); });
it("closureArrowCapture.aqua", async () => { it("closureArrowCapture.aqua", async () => {