File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -4,18 +4,16 @@ import { invokeWithErrorHandling } from 'core/util/error'
44describe ( 'invokeWithErrorHandling' , ( ) => {
55 if ( typeof Promise !== 'undefined' ) {
66 it ( 'should errorHandler call once when nested calls return rejected promise' , done => {
7- let times = 0
8-
9- Vue . config . errorHandler = function ( ) {
10- times ++
11- }
7+ const originalHandler = Vue . config . errorHandler
8+ const handler = Vue . config . errorHandler = jasmine . createSpy ( )
129
1310 invokeWithErrorHandling ( ( ) => {
1411 return invokeWithErrorHandling ( ( ) => {
1512 return Promise . reject ( new Error ( 'fake error' ) )
1613 } )
1714 } ) . then ( ( ) => {
18- expect ( times ) . toBe ( 1 )
15+ Vue . config . errorHandler = originalHandler
16+ expect ( handler . calls . count ( ) ) . toBe ( 1 )
1917 done ( )
2018 } )
2119 } )
You can’t perform that action at this time.
0 commit comments