From b3efd9320baaedee15728169059a33412da238c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kr=C3=A6n=20Hansen?= Date: Tue, 7 Jun 2022 15:56:24 +0200 Subject: [PATCH] Increasing timeout and deleting objects --- integration-tests/tests/src/tests/sync/sync-as-local.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/integration-tests/tests/src/tests/sync/sync-as-local.ts b/integration-tests/tests/src/tests/sync/sync-as-local.ts index ef315d5952..9347f9076b 100644 --- a/integration-tests/tests/src/tests/sync/sync-as-local.ts +++ b/integration-tests/tests/src/tests/sync/sync-as-local.ts @@ -33,12 +33,14 @@ describe.skipIf(environment.missingServer, "Synced Realm as local", () => { }); before(async function (this: RealmContext) { + this.timeout(5000); // Add a subscription await this.realm.subscriptions.update((subs) => { subs.add(this.realm.objects("Person")); }); - // Add a few objects + // Delete any existing object and add a single object this.realm.write(() => { + this.realm.deleteAll(); this.realm.create("Person", { _id: new Realm.BSON.ObjectId(), age: 23, @@ -55,6 +57,7 @@ describe.skipIf(environment.missingServer, "Synced Realm as local", () => { // @ts-expect-error Using sync: true is an undocumented API this.realm = new Realm({ path: realmPath, sync: true }); expect(this.realm.schema[0].name).equals("Person"); + console.log(this.realm.objects("Person").length); expect(this.realm.objects("Person")[0].name).equals("Alice"); }); });