Files
ruoyi-plus-vben5/apps/web-antd/src/store/modules/example.test.ts

18 lines
415 B
TypeScript
Raw Normal View History

2024-05-19 21:20:42 +08:00
import { createPinia, setActivePinia } from 'pinia';
2024-06-02 15:04:37 +08:00
import { beforeEach, describe, expect, it } from 'vitest';
2024-05-19 21:20:42 +08:00
2024-06-02 15:04:37 +08:00
import { useCounterStore } from './example';
2024-05-19 21:20:42 +08:00
2024-06-01 23:15:29 +08:00
describe('useCounterStore', () => {
2024-06-02 15:04:37 +08:00
beforeEach(() => {
2024-05-19 21:20:42 +08:00
setActivePinia(createPinia());
2024-06-02 15:04:37 +08:00
});
2024-05-19 21:20:42 +08:00
2024-06-02 15:04:37 +08:00
it('count test', () => {
setActivePinia(createPinia());
const counterStore = useCounterStore();
2024-05-19 21:20:42 +08:00
2024-06-02 15:04:37 +08:00
expect(counterStore.count).toBe(0);
2024-05-19 21:20:42 +08:00
});
});