File tree 2 files changed +24
-1
lines changed
2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ export default {
46
46
}
47
47
vm . _obSubscriptions . push ( obs [ key ] . subscribe ( value => {
48
48
vm [ key ] = value
49
- } ) )
49
+ } , ( error ) => { throw error } ) )
50
50
} )
51
51
}
52
52
} ,
Original file line number Diff line number Diff line change @@ -117,6 +117,29 @@ test('subscriptions() has access to component state', () => {
117
117
expect ( vm . $el . textContent ) . toBe ( 'FOOBAR' )
118
118
} )
119
119
120
+ test ( 'subscriptions() can throw error properly' , done => {
121
+ const { ob, next } = mock ( )
122
+
123
+ const vm = new Vue ( {
124
+ subscriptions ( ) {
125
+ return {
126
+ num : ob . startWith ( 1 ) . map ( n => n . toFixed ( ) )
127
+ }
128
+ } ,
129
+ render ( h ) {
130
+ return h ( 'div' , this . num )
131
+ }
132
+ } ) . $mount ( )
133
+
134
+ nextTick ( ( ) => {
135
+ expect ( ( ) => {
136
+ next ( null )
137
+ } ) . toThrow ( )
138
+ expect ( vm . $el . textContent ) . toBe ( '1' )
139
+ done ( )
140
+ } )
141
+ } )
142
+
120
143
test ( 'v-stream directive (basic)' , done => {
121
144
const vm = new Vue ( {
122
145
template : `
You can’t perform that action at this time.
0 commit comments