Skip to content

Commit a2c110e

Browse files
committed
test: fix types
1 parent b260d8b commit a2c110e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

__tests__/src/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,12 @@ export function spyOnSnapshotCallback(ref: FirestoreReference) {
5151
// This makes sure some tests fail by delaying callbacks
5252
export function delayUpdate(ref: firestore.DocumentReference, time = 0) {
5353
const onSnapshot = ref.onSnapshot.bind(ref)
54-
// @ts-ignore
5554
ref.onSnapshot = (fn) =>
56-
// @ts-ignore
5755
onSnapshot(async (...args) => {
5856
await delay(time)
57+
if (typeof fn !== 'function') {
58+
throw new Error('onSnapshot can only be called on function')
59+
}
5960
fn(...args)
6061
})
6162
}

0 commit comments

Comments
 (0)