Open History to see the last commit
1import { describe, expect, test } from 'vitest'
2import { render } from '@testing-library/svelte'
3import { getIsRestoringContext } from '../../src/index.js'
4import BaseExample from './BaseExample.svelte'
5β
6describe('getQueryClientContext', () => {
7 test('Throw when called without a client in context', () => {
8 expect(() => render(BaseExample)).toThrowError(
9 'No QueryClient was found in Svelte context. Did you forget to wrap your component with QueryClientProvider?',
10 )
11 })
12})
13β
14describe('getIsRestoringContext', () => {
15 test('Do not throw when called outside of a component', () => {
16 expect(() => getIsRestoringContext()).not.toThrowError()
17 })
18})