Skip to content

Commit 646f04e

Browse files
authored
test(angular-query-persist-client/withPersistQueryClient): move 'effect' into 'constructor' to follow Angular convention (#10538)
1 parent e3ecdc5 commit 646f04e

File tree

1 file changed

+27
-18
lines changed

1 file changed

+27
-18
lines changed

packages/angular-query-persist-client/src/__tests__/with-persist-query-client.test.ts

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,16 @@ describe('withPersistQueryClient', () => {
9797
queryKey: key,
9898
queryFn: () => sleep(10).then(() => 'fetched'),
9999
}))
100-
_ = effect(() => {
101-
states.push({
102-
status: this.state.status(),
103-
fetchStatus: this.state.fetchStatus(),
104-
data: this.state.data(),
100+
101+
constructor() {
102+
effect(() => {
103+
states.push({
104+
status: this.state.status(),
105+
fetchStatus: this.state.fetchStatus(),
106+
data: this.state.data(),
107+
})
105108
})
106-
})
109+
}
107110
}
108111

109112
const rendered = await render(Page, {
@@ -189,13 +192,16 @@ describe('withPersistQueryClient', () => {
189192
// otherwise initialData would be newer and takes precedence
190193
initialDataUpdatedAt: 1,
191194
}))
192-
_ = effect(() => {
193-
states.push({
194-
status: this.state.status(),
195-
fetchStatus: this.state.fetchStatus(),
196-
data: this.state.data(),
195+
196+
constructor() {
197+
effect(() => {
198+
states.push({
199+
status: this.state.status(),
200+
fetchStatus: this.state.fetchStatus(),
201+
data: this.state.data(),
202+
})
197203
})
198-
})
204+
}
199205
}
200206

201207
const rendered = await render(Page, {
@@ -280,13 +286,16 @@ describe('withPersistQueryClient', () => {
280286
},
281287
staleTime: Infinity,
282288
}))
283-
_ = effect(() => {
284-
states.push({
285-
status: this.state.status(),
286-
fetchStatus: this.state.fetchStatus(),
287-
data: this.state.data(),
289+
290+
constructor() {
291+
effect(() => {
292+
states.push({
293+
status: this.state.status(),
294+
fetchStatus: this.state.fetchStatus(),
295+
data: this.state.data(),
296+
})
288297
})
289-
})
298+
}
290299
}
291300

292301
const rendered = await render(Page, {

0 commit comments

Comments
 (0)