Skip to content

Commit

Permalink
Fixed failing a test
Browse files Browse the repository at this point in the history
  • Loading branch information
kraenhansen committed Jun 8, 2022
1 parent 4939434 commit edb5565
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions integration-tests/tests/src/tests/sync/flexible.ts
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,8 @@ describe.skipIf(environment.missingServer, "Flexible sync", function () {
const subs = this.realm.subscriptions;

subs.update((mutableSubs) => {
expect(() => (mutableSubs as unknown as Realm.App.Sync.SubscriptionSet).waitForSynchronization()).to.throw(
// @ts-expect-error Calling a missing function
expect(() => (mutableSubs as Realm.App.Sync.SubscriptionSet).waitForSynchronization()).to.throw(
"mutableSubs.waitForSynchronization is not a function",
);
});
Expand Down Expand Up @@ -817,7 +818,8 @@ describe.skipIf(environment.missingServer, "Flexible sync", function () {
it("mutating methods do not exist on non-mutable SubscriptionSet instances", function (this: RealmContext) {
const subscriptionInfo = addSubscriptionForPerson(this.realm);

const subsAsMutable = subscriptionInfo.subs as unknown as Realm.App.Sync.MutableSubscriptionSet;
// @ts-expect-error Calling missing functions
const subsAsMutable = subscriptionInfo.subs as Realm.App.Sync.MutableSubscriptionSet;

const calls = [
() => subsAsMutable.add(this.realm.objects(FlexiblePersonSchema.name)),
Expand Down Expand Up @@ -864,11 +866,12 @@ describe.skipIf(environment.missingServer, "Flexible sync", function () {

await expect(
subs.update((mutableSubs) => {
(mutableSubs as unknown as Realm.App.Sync.SubscriptionSet).update(() => {
// @ts-expect-error Calling a missing function
(mutableSubs as Realm.App.Sync.SubscriptionSet).update(() => {
// This should throw
});
}),
).to.be.rejectedWith("mutableSubs.update is not a function");
).to.be.rejectedWith("is not a function");
});
});

Expand Down

0 comments on commit edb5565

Please sign in to comment.