From bb5c102c35cab1bf23cd10aa8cab233a3824447a Mon Sep 17 00:00:00 2001 From: Evan You Date: Wed, 1 Jun 2016 17:14:02 -0400 Subject: [PATCH] fix errorHandler tests --- test/unit/features/global-api/config.spec.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/test/unit/features/global-api/config.spec.js b/test/unit/features/global-api/config.spec.js index cc02e4d8..7084b363 100644 --- a/test/unit/features/global-api/config.spec.js +++ b/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 + }) }) })