Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export default {
}
vm._obSubscriptions.push(obs[key].subscribe(value => {
vm[key] = value
}))
}, (error) => { throw error }))
})
}
},
Expand Down
23 changes: 23 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,29 @@ test('subscriptions() has access to component state', () => {
expect(vm.$el.textContent).toBe('FOOBAR')
})

test('subscriptions() can throw error properly', done => {
const { ob, next } = mock()

const vm = new Vue({
subscriptions () {
return {
num: ob.startWith(1).map(n => n.toFixed())
}
},
render (h) {
return h('div', this.num)
}
}).$mount()

nextTick(() => {
expect(() => {
next(null)
}).toThrow()
expect(vm.$el.textContent).toBe('1')
done()
})
})

test('v-stream directive (basic)', done => {
const vm = new Vue({
template: `
Expand Down