How to use the @posva/vuefire-test-helpers.Vue.use function in @posva/vuefire-test-helpers

To help you get started, we’ve selected a few @posva/vuefire-test-helpers examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github vuejs / vuefire / packages / vuefire / __tests__ / rtdb / bind.spec.ts View on Github external
import { rtdbPlugin } from '../../src'
import { Vue, tick, MockFirebase } from '@posva/vuefire-test-helpers'

Vue.use(rtdbPlugin)

describe('RTDB: manual bind', () => {
  async function createVm() {
    const source = new MockFirebase().child('data')
    const vm = new Vue({
      // purposely set items as null
      // but it's a good practice to set it to an empty array
      data: () => ({
        items: [],
        item: null,
      }),
    })
    await tick()

    return { vm, source }
  }
github vuejs / vuefire / packages / vuefire / __tests__ / firestore / bind.spec.ts View on Github external
import { firestorePlugin } from '../../src'
import { db, tick, delayUpdate, Vue } from '@posva/vuefire-test-helpers'
import { firestore } from 'firebase'
import { CombinedVueInstance } from 'vue/types/vue'

Vue.use(firestorePlugin)

describe('Firestore: binding', () => {
  let collection: firestore.CollectionReference,
    document: firestore.DocumentReference,
    vm: CombinedVueInstance>
  beforeEach(async () => {
    // @ts-ignore
    collection = db.collection()
    // @ts-ignore
    document = db.collection().doc()
    // @ts-ignore
    vm = new Vue({
      // purposely set items as null
      // but it's a good practice to set it to an empty array
      data: () => ({
        items: null,
github vuejs / vuefire / packages / vuexfire / __tests__ / firestore.spec.ts View on Github external
import Vuex from 'vuex'
import { vuexfireMutations, firestoreAction } from '../src'
import { db, tick, Vue, delayUpdate } from '@posva/vuefire-test-helpers'
import { firestore } from 'firebase'
import { FirestoreOptions } from '@posva/vuefire-core/dist/packages/@posva/vuefire-core/src'

Vue.use(Vuex)

describe('firestoreAction', () => {
  const item: any = null,
    items: any[] = []
  const store = new Vuex.Store<{ item: any; items: any[] }>({
    state: { item, items },
    mutations: vuexfireMutations,
    actions: {
      action: firestoreAction((context, fn) => fn(context)),
    },

    modules: {
      module: {
        namespaced: true,
        actions: {
          action: firestoreAction((context, fn) => fn(context)),
github vuejs / vuefire / packages / vuexfire / __tests__ / options.spec.ts View on Github external
import Vuex from 'vuex'
import { vuexfireMutations, firestoreAction } from '../src'
import { db, tick, Vue } from '@posva/vuefire-test-helpers'
import { firestore } from 'firebase'
import { FirestoreOptions } from '@posva/vuefire-core/dist/packages/@posva/vuefire-core/src'

Vue.use(Vuex)

describe('firestoreAction', () => {
  const item: any = null,
    items: any[] = []
  const store = new Vuex.Store<{ item: any; items: any[] }>({
    state: { item, items },
    mutations: vuexfireMutations,
    actions: {
      action: firestoreAction((context, fn) => fn(context)),
    },

    modules: {
      module: {
        namespaced: true,
        actions: {
          action: firestoreAction((context, fn) => fn(context)),
github vuejs / vuefire / packages / vuexfire / __tests__ / rtdb.spec.ts View on Github external
import Vuex from 'vuex'
import { firebaseAction, vuexfireMutations } from '../src'
import { MockFirebase, tick, Vue } from '@posva/vuefire-test-helpers'
import { database } from 'firebase'
import { RTDBOptions } from '@posva/vuefire-core/dist/packages/@posva/vuefire-core/src'

Vue.use(Vuex)

const db = new MockFirebase().child('data')

describe('RTDB: firebaseAction', () => {
  const item: any = null,
    items: any[] = []
  const store = new Vuex.Store<{ item: any; items: any[] }>({
    state: { items, item },
    mutations: vuexfireMutations,
    actions: {
      action: firebaseAction((context, fn) => fn(context)),
    },

    modules: {
      module: {
        namespaced: true,