Browse Source

fix errorHandler tests

dev
Evan You 9 years ago
parent
commit
bb5c102c35
  1. 17
      test/unit/features/global-api/config.spec.js

17
test/unit/features/global-api/config.spec.js

@ -35,12 +35,15 @@ describe('Global config', () => {
})
describe('errorHandler', () => {
Vue.config.errorHandler = spy
const err = new Error()
const vm = new Vue({
render () { throw err }
}).$mount()
expect(spy).toHaveBeenCalledWith(err, vm)
Vue.config.errorHandler = null
it('should be called with correct args', () => {
const spy = jasmine.createSpy('errorHandler')
Vue.config.errorHandler = spy
const err = new Error()
const vm = new Vue({
render () { throw err }
}).$mount()
expect(spy).toHaveBeenCalledWith(err, vm)
Vue.config.errorHandler = null
})
})
})

Loading…
Cancel
Save