@tanstack/query-core 4.14.0 → 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 +1 -1
- package/src/tests/query.test.tsx +11 -8
package/package.json
CHANGED
package/src/tests/query.test.tsx
CHANGED
|
@@ -134,8 +134,8 @@ describe('query', () => {
|
|
|
134
134
|
// There should not be a result yet
|
|
135
135
|
expect(result).toBeUndefined()
|
|
136
136
|
|
|
137
|
-
//
|
|
138
|
-
await
|
|
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
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
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 () => {
|