Skip to content

Commit fc8a6a9

Browse files
authored
test(angular-query*): prefix 'it' descriptions with 'should' for consistency (#10547)
1 parent b79bb92 commit fc8a6a9

10 files changed

Lines changed: 24 additions & 24 deletions

packages/angular-query-experimental/src/__tests__/infinite-query-options.test-d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ describe('infiniteQueryOptions', () => {
166166
)
167167
})
168168

169-
it('allow optional initialData function', () => {
169+
it('should allow optional initialData function', () => {
170170
const key = queryKey()
171171
const initialData: { example: boolean } | undefined = { example: true }
172172
const queryOptions = infiniteQueryOptions({
@@ -185,7 +185,7 @@ describe('infiniteQueryOptions', () => {
185185
>()
186186
})
187187

188-
it('allow optional initialData object', () => {
188+
it('should allow optional initialData object', () => {
189189
const key = queryKey()
190190
const initialData: { example: boolean } | undefined = { example: true }
191191
const queryOptions = infiniteQueryOptions({

packages/angular-query-experimental/src/__tests__/inject-infinite-query.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ describe('injectInfiniteQuery', () => {
6464
})
6565

6666
describe('injection context', () => {
67-
it('throws NG0203 with descriptive error outside injection context', () => {
67+
it('should throw NG0203 with descriptive error outside injection context', () => {
6868
const key = queryKey()
6969
expect(() => {
7070
injectInfiniteQuery(() => ({
@@ -77,7 +77,7 @@ describe('injectInfiniteQuery', () => {
7777
}).toThrow(/NG0203(.*?)injectInfiniteQuery/)
7878
})
7979

80-
it('can be used outside injection context when passing an injector', () => {
80+
it('should be usable outside injection context when passing an injector', () => {
8181
const key = queryKey()
8282
const query = injectInfiniteQuery(
8383
() => ({

packages/angular-query-experimental/src/__tests__/inject-is-fetching.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ describe('injectIsFetching', () => {
2828
vi.useRealTimers()
2929
})
3030

31-
it('Returns number of fetching queries', async () => {
31+
it('should return the number of fetching queries', async () => {
3232
const key = queryKey()
3333
const isFetching = TestBed.runInInjectionContext(() => {
3434
injectQuery(() => ({
@@ -46,13 +46,13 @@ describe('injectIsFetching', () => {
4646
})
4747

4848
describe('injection context', () => {
49-
it('throws NG0203 with descriptive error outside injection context', () => {
49+
it('should throw NG0203 with descriptive error outside injection context', () => {
5050
expect(() => {
5151
injectIsFetching()
5252
}).toThrow(/NG0203(.*?)injectIsFetching/)
5353
})
5454

55-
it('can be used outside injection context when passing an injector', () => {
55+
it('should be usable outside injection context when passing an injector', () => {
5656
expect(
5757
injectIsFetching(undefined, {
5858
injector: TestBed.inject(Injector),

packages/angular-query-experimental/src/__tests__/inject-is-mutating.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,13 @@ describe('injectIsMutating', () => {
5252
})
5353

5454
describe('injection context', () => {
55-
it('throws NG0203 with descriptive error outside injection context', () => {
55+
it('should throw NG0203 with descriptive error outside injection context', () => {
5656
expect(() => {
5757
injectIsMutating()
5858
}).toThrow(/NG0203(.*?)injectIsMutating/)
5959
})
6060

61-
it('can be used outside injection context when passing an injector', () => {
61+
it('should be usable outside injection context when passing an injector', () => {
6262
expect(
6363
injectIsMutating(undefined, {
6464
injector: TestBed.inject(Injector),

packages/angular-query-experimental/src/__tests__/inject-is-restoring.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ describe('injectIsRestoring', () => {
2121
})
2222
})
2323

24-
it('returns false by default when provideIsRestoring is not used', () => {
24+
it('should return false by default when provideIsRestoring is not used', () => {
2525
const isRestoring = TestBed.runInInjectionContext(() => {
2626
return injectIsRestoring()
2727
})
2828

2929
expect(isRestoring()).toBe(false)
3030
})
3131

32-
it('returns provided signal value when provideIsRestoring is used', () => {
32+
it('should return the provided signal value when provideIsRestoring is used', () => {
3333
const restoringSignal = signal(true)
3434

3535
TestBed.configureTestingModule({
@@ -43,15 +43,15 @@ describe('injectIsRestoring', () => {
4343
expect(isRestoring()).toBe(true)
4444
})
4545

46-
it('can be used outside injection context when passing an injector', () => {
46+
it('should be usable outside injection context when passing an injector', () => {
4747
const isRestoring = injectIsRestoring({
4848
injector: TestBed.inject(Injector),
4949
})
5050

5151
expect(isRestoring()).toBe(false)
5252
})
5353

54-
it('throws NG0203 with descriptive error outside injection context', () => {
54+
it('should throw NG0203 with descriptive error outside injection context', () => {
5555
expect(() => {
5656
injectIsRestoring()
5757
}).toThrow(/NG0203(.*?)injectIsRestoring/)

packages/angular-query-experimental/src/__tests__/inject-mutation-state.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ describe('injectMutationState', () => {
5959
expect(mutationState()).toEqual([variables])
6060
})
6161

62-
it('reactive options should update injectMutationState', () => {
62+
it('should update injectMutationState when reactive options change', () => {
6363
const mutationKey1 = queryKey()
6464
const mutationKey2 = queryKey()
6565
const variables1 = 'foo123'
@@ -179,13 +179,13 @@ describe('injectMutationState', () => {
179179
})
180180

181181
describe('injection context', () => {
182-
it('throws NG0203 with descriptive error outside injection context', () => {
182+
it('should throw NG0203 with descriptive error outside injection context', () => {
183183
expect(() => {
184184
injectMutationState()
185185
}).toThrow(/NG0203(.*?)injectMutationState/)
186186
})
187187

188-
it('can be used outside injection context when passing an injector', () => {
188+
it('should be usable outside injection context when passing an injector', () => {
189189
const injector = TestBed.inject(Injector)
190190
expect(
191191
injectMutationState(undefined, {

packages/angular-query-experimental/src/__tests__/inject-mutation.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ describe('injectMutation', () => {
114114
})
115115
})
116116

117-
it('reactive options should update mutation', () => {
117+
it('should update mutation when reactive options change', () => {
118118
const mutationCache = queryClient.getMutationCache()
119119
// Signal will be updated before the mutation is called
120120
// this test confirms that the mutation uses the updated value
@@ -473,7 +473,7 @@ describe('injectMutation', () => {
473473
})
474474

475475
describe('injection context', () => {
476-
it('throws NG0203 with descriptive error outside injection context', () => {
476+
it('should throw NG0203 with descriptive error outside injection context', () => {
477477
const key = queryKey()
478478
expect(() => {
479479
injectMutation(() => ({
@@ -483,7 +483,7 @@ describe('injectMutation', () => {
483483
}).toThrow(/NG0203(.*?)injectMutation/)
484484
})
485485

486-
it('can be used outside injection context when passing an injector', () => {
486+
it('should be usable outside injection context when passing an injector', () => {
487487
const key = queryKey()
488488
expect(() => {
489489
injectMutation(

packages/angular-query-experimental/src/__tests__/inject-query.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@ describe('injectQuery', () => {
593593
})
594594

595595
describe('injection context', () => {
596-
it('throws NG0203 with descriptive error outside injection context', () => {
596+
it('should throw NG0203 with descriptive error outside injection context', () => {
597597
const key = queryKey()
598598
expect(() => {
599599
injectQuery(() => ({
@@ -603,7 +603,7 @@ describe('injectQuery', () => {
603603
}).toThrow(/NG0203(.*?)injectQuery/)
604604
})
605605

606-
it('can be used outside injection context when passing an injector', () => {
606+
it('should be usable outside injection context when passing an injector', () => {
607607
const key = queryKey()
608608
const query = injectQuery(
609609
() => ({

packages/angular-query-experimental/src/__tests__/signal-proxy.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ describe('signalProxy', () => {
1616
expect(isSignal(proxy.fn)).toBe(false)
1717
})
1818

19-
it('supports "in" operator', () => {
19+
it('should support "in" operator', () => {
2020
expect('baz' in proxy).toBe(true)
2121
expect('foo' in proxy).toBe(false)
2222
})
2323

24-
it('supports "Object.keys"', () => {
24+
it('should support "Object.keys"', () => {
2525
expect(Object.keys(proxy)).toEqual(['fn', 'baz'])
2626
})
2727
})

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ describe('withPersistQueryClient', () => {
6262
vi.useRealTimers()
6363
})
6464

65-
it('restores cache from persister', async () => {
65+
it('should restore cache from persister', async () => {
6666
const key = queryKey()
6767
const states: Array<{
6868
status: string

0 commit comments

Comments
 (0)