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 @@ -31,7 +31,7 @@ describe('injectIsMutating', () => {
vi.useRealTimers()
})

test('should properly return isMutating state', async () => {
test('should properly return isMutating state', () => {
TestBed.runInInjectionContext(() => {
const isMutating = injectIsMutating()
const mutation = injectMutation(() => ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ describe('injectMutation', () => {
})
})

test('reactive options should update mutation', async () => {
test('reactive options should update mutation', () => {
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
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ describe('injectQuery', () => {
...options,
}))
const fromWrappedQuery = TestBed.runInInjectionContext(() =>
createWrappedQuery([''], async () => '1'),
createWrappedQuery([''], () => Promise.resolve('1')),
)
expectTypeOf(fromWrappedQuery.data()).toEqualTypeOf<string | undefined>()

Expand All @@ -252,7 +252,7 @@ describe('injectQuery', () => {
>,
) => injectQuery(() => ({ queryKey: qk, queryFn: fetcher, ...options }))
const fromWrappedFuncStyleQuery = TestBed.runInInjectionContext(() =>
createWrappedFuncStyleQuery([''], async () => true),
createWrappedFuncStyleQuery([''], () => Promise.resolve(true)),
)
expectTypeOf(fromWrappedFuncStyleQuery.data()).toEqualTypeOf<
boolean | undefined
Expand Down
16 changes: 8 additions & 8 deletions packages/query-devtools/src/__tests__/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { deleteNestedDataByPath, updateNestedDataByPath } from '../utils'
describe('Utils tests', () => {
describe('updatedNestedDataByPath', () => {
describe('array', () => {
it('should update data correctly', async () => {
it('should update data correctly', () => {
const oldData = ['one', 'two', 'three']

const newData = updateNestedDataByPath(oldData, ['1'], 'new')
Expand All @@ -29,7 +29,7 @@ describe('Utils tests', () => {
})

describe('object', () => {
it('should update data correctly', async () => {
it('should update data correctly', () => {
const oldData = { title: 'Hello world', id: 1, createdAt: '2021-01-01' }

const newData = updateNestedDataByPath(
Expand Down Expand Up @@ -58,7 +58,7 @@ describe('Utils tests', () => {
})

describe('set', () => {
it('should update data correctly', async () => {
it('should update data correctly', () => {
const oldData = new Set([123, 321, 'hello', 'world'])

const newData = updateNestedDataByPath(oldData, ['2'], 'hi')
Expand All @@ -85,7 +85,7 @@ describe('Utils tests', () => {
})

describe('map', () => {
it('should update data correctly', async () => {
it('should update data correctly', () => {
const oldData = new Map([
['en', 'hello'],
['fr', 'bonjour'],
Expand Down Expand Up @@ -113,7 +113,7 @@ describe('Utils tests', () => {
})

describe('nested data', () => {
it('should update data correctly', async () => {
it('should update data correctly', () => {
/* eslint-disable cspell/spellchecker */
const oldData = new Map([
[
Expand Down Expand Up @@ -377,7 +377,7 @@ describe('Utils tests', () => {
})

describe('deleteNestedDataByPath', () => {
it('should delete item from array correctly', async () => {
it('should delete item from array correctly', () => {
const oldData = ['one', 'two', 'three']

const newData = deleteNestedDataByPath(oldData, ['1'])
Expand All @@ -399,7 +399,7 @@ describe('Utils tests', () => {
`)
})

it('should delete item from object correctly', async () => {
it('should delete item from object correctly', () => {
const oldData = { title: 'Hello world', id: 1, createdAt: '2021-01-01' }

const newData = deleteNestedDataByPath(oldData, ['createdAt'])
Expand Down Expand Up @@ -472,7 +472,7 @@ describe('Utils tests', () => {
})

describe('nested data', () => {
it('should delete nested items correctly', async () => {
it('should delete nested items correctly', () => {
/* eslint-disable cspell/spellchecker */
const oldData = new Map([
[
Expand Down
2 changes: 1 addition & 1 deletion packages/query-persist-client-core/src/__tests__/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export function createMockPersister(): Persister {
let storedState: PersistedClient | undefined

return {
async persistClient(persistClient: PersistedClient) {
persistClient(persistClient: PersistedClient) {
storedState = persistClient
},
async restoreClient() {
Expand Down
Loading