Skip to content

Commit f276b80

Browse files
committed
refactor: upgrade to firebase 8
1 parent c1adcd3 commit f276b80

23 files changed

+445
-283
lines changed

__tests__/core/firestore/collection.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { bindCollection } from '../../../src/core'
22
import { db, createOps, spyUnbind } from '../../src'
3-
import { firestore } from 'firebase'
3+
import * as firestore from '@firebase/firestore-types'
44
import { OperationsType } from '../../../src/core'
55
import { ref, Ref } from 'vue'
66

__tests__/core/firestore/document.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { bindDocument } from '../../../src/core'
22
import { db, spyUnbind, createOps } from '../../src'
3-
import { firestore } from 'firebase'
3+
import * as firestore from '@firebase/firestore-types'
44
import { OperationsType } from '../../../src/shared'
55
import { ref, Ref } from 'vue'
66

__tests__/core/firestore/options.spec.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
bindCollection,
55
} from '../../../src/core'
66
import { db, createOps } from '../../src'
7-
import { firestore } from 'firebase'
7+
import * as firestore from '@firebase/firestore-types'
88
import { Ref, ref } from 'vue'
99

1010
describe('options', () => {
@@ -32,7 +32,8 @@ describe('options', () => {
3232
bindDocument(target, document, ops, resolve, reject, { serialize: spy })
3333
})
3434
expect(spy).toHaveBeenCalledTimes(1)
35-
expect(spy).toBeCalledWith(
35+
expect(spy).toHaveBeenCalledWith(
36+
// @ts-ignore WTF TS?????
3637
expect.objectContaining({ data: expect.any(Function) })
3738
)
3839
expect(target.value).toEqual({ bar: 'foo' })
@@ -49,6 +50,7 @@ describe('options', () => {
4950
})
5051
expect(spy).toHaveBeenCalledTimes(1)
5152
expect(spy).toBeCalledWith(
53+
// @ts-ignore WTF TS?????
5254
expect.objectContaining({ data: expect.any(Function) })
5355
)
5456
expect(target.value).toEqual([{ bar: 'foo' }])
@@ -65,6 +67,7 @@ describe('options', () => {
6567
})
6668
expect(spy).toHaveBeenCalledTimes(1)
6769
expect(spy).toBeCalledWith(
70+
// @ts-ignore WTF TS?????
6871
expect.objectContaining({ data: expect.any(Function) })
6972
)
7073
expect(target.value).toEqual({ bar: 'foo' })
@@ -83,6 +86,7 @@ describe('options', () => {
8386
})
8487
expect(spy).toHaveBeenCalledTimes(1)
8588
expect(spy).toBeCalledWith(
89+
// @ts-ignore WTF TS?????
8690
expect.objectContaining({ data: expect.any(Function) })
8791
)
8892
expect(target.value).toEqual([{ bar: 'foo' }])

__tests__/core/firestore/refs-collections.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { bindCollection, FirestoreOptions } from '../../../src/core'
22
import { db, delay, spyUnbind, delayUpdate, createOps } from '../../src'
33
import { OperationsType } from '../../../src/shared'
4-
import { firestore } from 'firebase'
4+
import * as firestore from '@firebase/firestore-types'
55
import { ref } from 'vue'
66

77
const buildRefs = () => ({

__tests__/core/firestore/refs-documents.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
spyOnSnapshotCallback,
88
createOps,
99
} from '../../src'
10-
import { firestore } from 'firebase'
10+
import * as firestore from '@firebase/firestore-types'
1111
import { OperationsType } from '../../../src/shared'
1212
import { ref, watch } from 'vue'
1313

__tests__/core/rtdb/options.spec.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ describe('RTDB options', () => {
4141

4242
expect(spy).toHaveBeenCalledTimes(2)
4343
expect(spy).toHaveBeenLastCalledWith(
44+
// @ts-ignore WTF TS?????
4445
expect.objectContaining({ val: expect.any(Function) })
4546
)
4647
expect(target.value).toEqual({ bar: 'foo' })
@@ -66,6 +67,7 @@ describe('RTDB options', () => {
6667

6768
expect(spy).toHaveBeenCalledTimes(1)
6869
expect(spy).toBeCalledWith(
70+
// @ts-ignore WTF TS?????
6971
expect.objectContaining({ val: expect.any(Function) })
7072
)
7173
expect(target.value).toEqual([{ bar: 'foo' }])
@@ -93,6 +95,7 @@ describe('RTDB options', () => {
9395

9496
expect(spy).toHaveBeenCalledTimes(2)
9597
expect(spy).toBeCalledWith(
98+
// @ts-ignore WTF TS?????
9699
expect.objectContaining({ val: expect.any(Function) })
97100
)
98101
expect(target.value).toEqual({ bar: 'foo' })
@@ -122,6 +125,7 @@ describe('RTDB options', () => {
122125

123126
expect(spy).toHaveBeenCalledTimes(1)
124127
expect(spy).toBeCalledWith(
128+
// @ts-ignore WTF TS?????
125129
expect.objectContaining({ val: expect.any(Function) })
126130
)
127131
expect(target.value).toEqual([{ bar: 'foo' }])

__tests__/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { nextTick } from 'vue-demi'
22
import { MockFirebase, MockedReference } from 'firebase-mock'
3-
import { firestore } from 'firebase'
3+
import * as firestore from '@firebase/firestore-types'
44
import { walkSet } from '../../src/core'
55

66
// Vue.config.productionTip = false

__tests__/vuefire/firestore/bind.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { firestorePlugin } from '../../../src'
22
import { db, tick, delayUpdate } from '../../src'
3-
import { firestore } from 'firebase'
3+
import * as firestore from '@firebase/firestore-types'
44
import { ComponentPublicInstance } from 'vue'
55
import { mount, VueWrapper } from '@vue/test-utils'
66

__tests__/vuefire/firestore/index.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { firestorePlugin } from '../../../src'
22
import { db, tick } from '../../src'
3-
import { firestore } from 'firebase'
3+
import * as firestore from '@firebase/firestore-types'
44
import { ComponentPublicInstance } from 'vue'
55
import { mount, VueWrapper } from '@vue/test-utils'
66

__tests__/vuefire/firestore/merging.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { firestorePlugin } from '../../../src'
22
import { db } from '../../src'
3-
import { firestore } from 'firebase'
3+
import * as firestore from '@firebase/firestore-types'
44
import { mount } from '@vue/test-utils'
55

66
// FIXME: implement merging strategies

0 commit comments

Comments
 (0)