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