nextTick,
defineComponent,
} from '@vue/composition-api'
+import { mockWarn } from 'jest-mock-warn'
describe('Map Helpers', () => {
const useCartStore = defineStore({ id: 'cart' })
localVue.use(PiniaPlugin)
describe('mapStores', () => {
+ mockWarn()
it('mapStores computes only once when mapping one store', async () => {
const pinia = createPinia()
const fromStore = jest.fn(function () {
await wrapper.trigger('click')
expect(wrapper.text()).toBe('2')
})
+
+ it('should warn when an array is passed', () => {
+ mapStores([])
+ expect('pass all stores to "mapStores()"').toHaveBeenWarned()
+ })
})
it('mapGetters', () => {