mirror of
https://github.com/vitest-dev/vitest.git
synced 2025-12-08 18:26:03 +00:00
17 lines
401 B
TypeScript
17 lines
401 B
TypeScript
import zustand from 'zustand'
|
|
import { magic } from '../src/zustand-magic'
|
|
|
|
vi.mock('zustand')
|
|
|
|
describe('zustand didn\'t go into an infinite loop', () => {
|
|
test('zustand is mocked', () => {
|
|
expect(vi.isMockFunction(zustand)).toBe(true)
|
|
})
|
|
|
|
test('magic calls zustand', () => {
|
|
const store = magic()
|
|
expect(zustand).toHaveBeenCalled()
|
|
expect(store).toBeTypeOf('function')
|
|
})
|
|
})
|