| 123456789101112131415161718192021222324252627282930313233 |
- import { Store } from 'vuex'
- import VuexORM from "@vuex-orm/core";
- import {mount, createLocalVue} from "@vue/test-utils"
- import {AnyJson} from "~/types/interfaces";
- const localVue = createLocalVue()
- export function initLocalVue(ctx:AnyJson){
- localVue.prototype.$nuxt = {
- context: ctx
- }
- }
- export function mountComposition(cb: () => any){
- return mount(
- {
- setup() {
- return cb();
- },
- render(h) {
- return h('div');
- }
- },
- { localVue }
- );
- }
- export function createStore(): Store<any> {
- return new Store({
- plugins: [VuexORM.install()],
- strict: true
- })
- }
|