Skip to content

Commit

Permalink
test(query-core): add test case for keepPreviousData (#8719)
Browse files Browse the repository at this point in the history
  • Loading branch information
manudeli authored Feb 28, 2025
1 parent 0f7510d commit 889d871
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/query-core/src/__tests__/utils.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
addToStart,
isPlainArray,
isPlainObject,
keepPreviousData,
matchMutation,
partialMatchKey,
replaceEqualDeep,
Expand Down Expand Up @@ -405,6 +406,13 @@ describe('core/utils', () => {
})
})

describe('keepPreviousData', () => {
it('should return the parameter as is', () => {
const x = { a: 1, b: 2 }
expect(keepPreviousData(x)).toEqual(x)
})
})

describe('addToEnd', () => {
it('should add item to the end of the array', () => {
const items = [1, 2, 3]
Expand Down

0 comments on commit 889d871

Please sign in to comment.