From: Eduardo San Martin Morote Date: Wed, 3 Mar 2021 14:40:10 +0000 (+0100) Subject: test: update to handle new api X-Git-Tag: v0.2.0~36 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4b9c35ac0a1bb5dfe925e7bd051bfa458d26b6f2;p=thirdparty%2Fvuejs%2Fpinia.git test: update to handle new api --- diff --git a/__tests__/state.spec.ts b/__tests__/state.spec.ts index 96bec861..44da9bf4 100644 --- a/__tests__/state.spec.ts +++ b/__tests__/state.spec.ts @@ -1,10 +1,14 @@ -import { defineStore, setActiveReq } from '../src' import { computed } from '@vue/composition-api' +import Vue from 'vue' +import { defineStore, setActivePinia, createPinia, Pinia } from '../src' describe('State', () => { + let pinia: Pinia const useStore = () => { // create a new store - setActiveReq({}) + pinia = createPinia() + pinia.Vue = Vue + setActivePinia(pinia) return defineStore({ id: 'main', state: () => ({ diff --git a/__tests__/store.patch.spec.ts b/__tests__/store.patch.spec.ts index 25b68b9f..ffe2e2bb 100644 --- a/__tests__/store.patch.spec.ts +++ b/__tests__/store.patch.spec.ts @@ -1,9 +1,14 @@ -import { defineStore, setActiveReq } from '../src' +import Vue from 'vue' +import { defineStore, setActivePinia, createPinia, Pinia } from '../src' describe('store.patch', () => { + let pinia: Pinia const useStore = () => { // create a new store - setActiveReq({}) + pinia = createPinia() + // this is done by Vue.install(pinia) + pinia.Vue = Vue + setActivePinia(pinia) return defineStore({ id: 'main', state: () => ({ diff --git a/__tests__/subscriptions.spec.ts b/__tests__/subscriptions.spec.ts index 859f3cc2..2884b8cb 100644 --- a/__tests__/subscriptions.spec.ts +++ b/__tests__/subscriptions.spec.ts @@ -1,9 +1,13 @@ -import { defineStore, setActiveReq } from '../src' +import Vue from 'vue' +import { defineStore, setActivePinia, createPinia, Pinia } from '../src' describe('Subscriptions', () => { + let pinia: Pinia const useStore = () => { + pinia = createPinia() + pinia.Vue = Vue // create a new store - setActiveReq({}) + setActivePinia(pinia) return defineStore({ id: 'main', state: () => ({