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