@tanstack/query-core 4.14.1 → 4.14.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/query-core",
3
- "version": "4.14.1",
3
+ "version": "4.14.3",
4
4
  "description": "The framework agnostic core that powers TanStack Query",
5
5
  "author": "tannerlinsley",
6
6
  "license": "MIT",
@@ -134,8 +134,8 @@ describe('query', () => {
134
134
  // There should not be a result yet
135
135
  expect(result).toBeUndefined()
136
136
 
137
- // By now we should have a value
138
- await sleep(50)
137
+ // Promise should eventually be resolved
138
+ await promise
139
139
  expect(result).toBe('data3')
140
140
  })
141
141
 
@@ -174,12 +174,15 @@ describe('query', () => {
174
174
  query.cancel()
175
175
 
176
176
  // Check if the error is set to the cancelled error
177
- await sleep(0)
178
- expect(isCancelledError(result)).toBe(true)
179
-
180
- // Reset visibilityState to original value
181
- visibilityMock.mockRestore()
182
- window.dispatchEvent(new FocusEvent('focus'))
177
+ try {
178
+ await promise
179
+ } catch {
180
+ expect(isCancelledError(result)).toBe(true)
181
+ } finally {
182
+ // Reset visibilityState to original value
183
+ visibilityMock.mockRestore()
184
+ window.dispatchEvent(new FocusEvent('focus'))
185
+ }
183
186
  })
184
187
 
185
188
  test('should provide context to queryFn', async () => {