Skip to content

Commit 889d871

Browse files
authored
test(query-core): add test case for keepPreviousData (#8719)
1 parent 0f7510d commit 889d871

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

packages/query-core/src/__tests__/utils.test.tsx

+8
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {
44
addToStart,
55
isPlainArray,
66
isPlainObject,
7+
keepPreviousData,
78
matchMutation,
89
partialMatchKey,
910
replaceEqualDeep,
@@ -405,6 +406,13 @@ describe('core/utils', () => {
405406
})
406407
})
407408

409+
describe('keepPreviousData', () => {
410+
it('should return the parameter as is', () => {
411+
const x = { a: 1, b: 2 }
412+
expect(keepPreviousData(x)).toEqual(x)
413+
})
414+
})
415+
408416
describe('addToEnd', () => {
409417
it('should add item to the end of the array', () => {
410418
const items = [1, 2, 3]

0 commit comments

Comments
 (0)