diff --git a/packages/angular-query-experimental/src/__tests__/inject-queries.test.ts b/packages/angular-query-experimental/src/__tests__/inject-queries.test.ts index 57fe3ed8af..d8fc60d233 100644 --- a/packages/angular-query-experimental/src/__tests__/inject-queries.test.ts +++ b/packages/angular-query-experimental/src/__tests__/inject-queries.test.ts @@ -58,10 +58,12 @@ describe('injectQueries', () => { ], })) - _ = effect(() => { - const snapshot = this.result().map((q) => ({ data: q.data() })) - results.push(snapshot) - }) + constructor() { + effect(() => { + const snapshot = this.result().map((q) => ({ data: q.data() })) + results.push(snapshot) + }) + } } const rendered = await render(Page, { @@ -111,9 +113,11 @@ describe('injectQueries', () => { }), })) - _ = effect(() => { - results.push({ ...this.combined() }) - }) + constructor() { + effect(() => { + results.push({ ...this.combined() }) + }) + } } const rendered = await render(Page, { diff --git a/packages/angular-query-persist-client/src/__tests__/with-persist-query-client.test.ts b/packages/angular-query-persist-client/src/__tests__/with-persist-query-client.test.ts index 3190867140..093efb825a 100644 --- a/packages/angular-query-persist-client/src/__tests__/with-persist-query-client.test.ts +++ b/packages/angular-query-persist-client/src/__tests__/with-persist-query-client.test.ts @@ -97,13 +97,16 @@ describe('withPersistQueryClient', () => { queryKey: key, queryFn: () => sleep(10).then(() => 'fetched'), })) - _ = effect(() => { - states.push({ - status: this.state.status(), - fetchStatus: this.state.fetchStatus(), - data: this.state.data(), + + constructor() { + effect(() => { + states.push({ + status: this.state.status(), + fetchStatus: this.state.fetchStatus(), + data: this.state.data(), + }) }) - }) + } } const rendered = await render(Page, { @@ -189,13 +192,16 @@ describe('withPersistQueryClient', () => { // otherwise initialData would be newer and takes precedence initialDataUpdatedAt: 1, })) - _ = effect(() => { - states.push({ - status: this.state.status(), - fetchStatus: this.state.fetchStatus(), - data: this.state.data(), + + constructor() { + effect(() => { + states.push({ + status: this.state.status(), + fetchStatus: this.state.fetchStatus(), + data: this.state.data(), + }) }) - }) + } } const rendered = await render(Page, { @@ -280,13 +286,16 @@ describe('withPersistQueryClient', () => { }, staleTime: Infinity, })) - _ = effect(() => { - states.push({ - status: this.state.status(), - fetchStatus: this.state.fetchStatus(), - data: this.state.data(), + + constructor() { + effect(() => { + states.push({ + status: this.state.status(), + fetchStatus: this.state.fetchStatus(), + data: this.state.data(), + }) }) - }) + } } const rendered = await render(Page, {