File tree 1 file changed +10
-8
lines changed
1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -26,20 +26,22 @@ export function spyOnSnapshot (ref) {
26
26
export function spyOnSnapshotCallback ( ref ) {
27
27
const onSnapshot = ref . onSnapshot . bind ( ref )
28
28
const spy = jest . fn ( )
29
- ref . onSnapshot = fn => onSnapshot ( ( ...args ) => {
30
- spy ( )
31
- fn ( ...args )
32
- } )
29
+ ref . onSnapshot = fn =>
30
+ onSnapshot ( ( ...args ) => {
31
+ spy ( )
32
+ fn ( ...args )
33
+ } )
33
34
return spy
34
35
}
35
36
36
37
// This makes sure some tests fail by delaying callbacks
37
38
export function delayUpdate ( ref , time = 0 ) {
38
39
const onSnapshot = ref . onSnapshot . bind ( ref )
39
- ref . onSnapshot = fn => onSnapshot ( async ( ...args ) => {
40
- await delay ( time )
41
- fn ( ...args )
42
- } )
40
+ ref . onSnapshot = fn =>
41
+ onSnapshot ( async ( ...args ) => {
42
+ await delay ( time )
43
+ fn ( ...args )
44
+ } )
43
45
}
44
46
45
47
export function tick ( ) {
You can’t perform that action at this time.
0 commit comments