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'
4
4
describe ( 'invokeWithErrorHandling' , ( ) => {
5
5
if ( typeof Promise !== 'undefined' ) {
6
6
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 ( )
12
9
13
10
invokeWithErrorHandling ( ( ) => {
14
11
return invokeWithErrorHandling ( ( ) => {
15
12
return Promise . reject ( new Error ( 'fake error' ) )
16
13
} )
17
14
} ) . then ( ( ) => {
18
- expect ( times ) . toBe ( 1 )
15
+ Vue . config . errorHandler = originalHandler
16
+ expect ( handler . calls . count ( ) ) . toBe ( 1 )
19
17
done ( )
20
18
} )
21
19
} )
You can’t perform that action at this time.
0 commit comments