File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,11 @@ function createListenerCollection() {
24
24
}
25
25
} )
26
26
} ,
27
+
28
+ get ( ) {
29
+ return current
30
+ } ,
31
+
27
32
subscribe : function subscribe ( listener ) {
28
33
var currentId = id ++
29
34
current [ currentId ] = listener
Original file line number Diff line number Diff line change @@ -97,11 +97,11 @@ describe('React', () => {
97
97
</ ProviderMock >
98
98
)
99
99
100
- expect ( rootSubscription . listeners . get ( ) . length ) . toBe ( 1 )
100
+ expect ( Object . keys ( rootSubscription . listeners . get ( ) ) . length ) . toBe ( 1 )
101
101
102
102
store . dispatch ( { type : '' } )
103
103
104
- expect ( rootSubscription . listeners . get ( ) . length ) . toBe ( 2 )
104
+ expect ( Object . keys ( rootSubscription . listeners . get ( ) ) . length ) . toBe ( 2 )
105
105
} )
106
106
107
107
it ( 'unsubscribes when the component is unmounted' , ( ) => {
@@ -125,11 +125,11 @@ describe('React', () => {
125
125
</ ProviderMock >
126
126
)
127
127
128
- expect ( rootSubscription . listeners . get ( ) . length ) . toBe ( 2 )
128
+ expect ( Object . keys ( rootSubscription . listeners . get ( ) ) . length ) . toBe ( 2 )
129
129
130
130
store . dispatch ( { type : '' } )
131
131
132
- expect ( rootSubscription . listeners . get ( ) . length ) . toBe ( 1 )
132
+ expect ( Object . keys ( rootSubscription . listeners . get ( ) ) . length ) . toBe ( 1 )
133
133
} )
134
134
135
135
it ( 'notices store updates between render and store subscription effect' , ( ) => {
You can’t perform that action at this time.
0 commit comments