File tree Expand file tree Collapse file tree 2 files changed +24
-1
lines changed
Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ export default {
4646 }
4747 vm . _obSubscriptions . push ( obs [ key ] . subscribe ( value => {
4848 vm [ key ] = value
49- } ) )
49+ } , ( error ) => { throw error } ) )
5050 } )
5151 }
5252 } ,
Original file line number Diff line number Diff line change @@ -117,6 +117,29 @@ test('subscriptions() has access to component state', () => {
117117 expect ( vm . $el . textContent ) . toBe ( 'FOOBAR' )
118118} )
119119
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+
120143test ( 'v-stream directive (basic)' , done => {
121144 const vm = new Vue ( {
122145 template : `
You can’t perform that action at this time.
0 commit comments