Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ describe('infiniteQueryOptions', () => {
)
})

it('allow optional initialData function', () => {
it('should allow optional initialData function', () => {
const key = queryKey()
const initialData: { example: boolean } | undefined = { example: true }
const queryOptions = infiniteQueryOptions({
Expand All @@ -185,7 +185,7 @@ describe('infiniteQueryOptions', () => {
>()
})

it('allow optional initialData object', () => {
it('should allow optional initialData object', () => {
const key = queryKey()
const initialData: { example: boolean } | undefined = { example: true }
const queryOptions = infiniteQueryOptions({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ describe('injectInfiniteQuery', () => {
})

describe('injection context', () => {
it('throws NG0203 with descriptive error outside injection context', () => {
it('should throw NG0203 with descriptive error outside injection context', () => {
const key = queryKey()
expect(() => {
injectInfiniteQuery(() => ({
Expand All @@ -77,7 +77,7 @@ describe('injectInfiniteQuery', () => {
}).toThrow(/NG0203(.*?)injectInfiniteQuery/)
})

it('can be used outside injection context when passing an injector', () => {
it('should be usable outside injection context when passing an injector', () => {
const key = queryKey()
const query = injectInfiniteQuery(
() => ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe('injectIsFetching', () => {
vi.useRealTimers()
})

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

describe('injection context', () => {
it('throws NG0203 with descriptive error outside injection context', () => {
it('should throw NG0203 with descriptive error outside injection context', () => {
expect(() => {
injectIsFetching()
}).toThrow(/NG0203(.*?)injectIsFetching/)
})

it('can be used outside injection context when passing an injector', () => {
it('should be usable outside injection context when passing an injector', () => {
expect(
injectIsFetching(undefined, {
injector: TestBed.inject(Injector),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ describe('injectIsMutating', () => {
})

describe('injection context', () => {
it('throws NG0203 with descriptive error outside injection context', () => {
it('should throw NG0203 with descriptive error outside injection context', () => {
expect(() => {
injectIsMutating()
}).toThrow(/NG0203(.*?)injectIsMutating/)
})

it('can be used outside injection context when passing an injector', () => {
it('should be usable outside injection context when passing an injector', () => {
expect(
injectIsMutating(undefined, {
injector: TestBed.inject(Injector),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ describe('injectIsRestoring', () => {
})
})

it('returns false by default when provideIsRestoring is not used', () => {
it('should return false by default when provideIsRestoring is not used', () => {
const isRestoring = TestBed.runInInjectionContext(() => {
return injectIsRestoring()
})

expect(isRestoring()).toBe(false)
})

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

TestBed.configureTestingModule({
Expand All @@ -43,15 +43,15 @@ describe('injectIsRestoring', () => {
expect(isRestoring()).toBe(true)
})

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

expect(isRestoring()).toBe(false)
})

it('throws NG0203 with descriptive error outside injection context', () => {
it('should throw NG0203 with descriptive error outside injection context', () => {
expect(() => {
injectIsRestoring()
}).toThrow(/NG0203(.*?)injectIsRestoring/)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ describe('injectMutationState', () => {
expect(mutationState()).toEqual([variables])
})

it('reactive options should update injectMutationState', () => {
it('should update injectMutationState when reactive options change', () => {
const mutationKey1 = queryKey()
const mutationKey2 = queryKey()
const variables1 = 'foo123'
Expand Down Expand Up @@ -179,13 +179,13 @@ describe('injectMutationState', () => {
})

describe('injection context', () => {
it('throws NG0203 with descriptive error outside injection context', () => {
it('should throw NG0203 with descriptive error outside injection context', () => {
expect(() => {
injectMutationState()
}).toThrow(/NG0203(.*?)injectMutationState/)
})

it('can be used outside injection context when passing an injector', () => {
it('should be usable outside injection context when passing an injector', () => {
const injector = TestBed.inject(Injector)
expect(
injectMutationState(undefined, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ describe('injectMutation', () => {
})
})

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

describe('injection context', () => {
it('throws NG0203 with descriptive error outside injection context', () => {
it('should throw NG0203 with descriptive error outside injection context', () => {
const key = queryKey()
expect(() => {
injectMutation(() => ({
Expand All @@ -483,7 +483,7 @@ describe('injectMutation', () => {
}).toThrow(/NG0203(.*?)injectMutation/)
})

it('can be used outside injection context when passing an injector', () => {
it('should be usable outside injection context when passing an injector', () => {
const key = queryKey()
expect(() => {
injectMutation(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ describe('injectQuery', () => {
})

describe('injection context', () => {
it('throws NG0203 with descriptive error outside injection context', () => {
it('should throw NG0203 with descriptive error outside injection context', () => {
const key = queryKey()
expect(() => {
injectQuery(() => ({
Expand All @@ -603,7 +603,7 @@ describe('injectQuery', () => {
}).toThrow(/NG0203(.*?)injectQuery/)
})

it('can be used outside injection context when passing an injector', () => {
it('should be usable outside injection context when passing an injector', () => {
const key = queryKey()
const query = injectQuery(
() => ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ describe('signalProxy', () => {
expect(isSignal(proxy.fn)).toBe(false)
})

it('supports "in" operator', () => {
it('should support "in" operator', () => {
expect('baz' in proxy).toBe(true)
expect('foo' in proxy).toBe(false)
})

it('supports "Object.keys"', () => {
it('should support "Object.keys"', () => {
expect(Object.keys(proxy)).toEqual(['fn', 'baz'])
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ describe('withPersistQueryClient', () => {
vi.useRealTimers()
})

it('restores cache from persister', async () => {
it('should restore cache from persister', async () => {
const key = queryKey()
const states: Array<{
status: string
Expand Down
Loading