We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2f3020e commit 173042bCopy full SHA for 173042b
test/unit/modules/util/invoke-with-error-handling.spec.js
@@ -4,18 +4,16 @@ import { invokeWithErrorHandling } from 'core/util/error'
4
describe('invokeWithErrorHandling', () => {
5
if (typeof Promise !== 'undefined') {
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
- }
+ const originalHandler = Vue.config.errorHandler
+ const handler = Vue.config.errorHandler = jasmine.createSpy()
12
13
invokeWithErrorHandling(() => {
14
return invokeWithErrorHandling(() => {
15
return Promise.reject(new Error('fake error'))
16
})
17
}).then(() => {
18
- expect(times).toBe(1)
+ Vue.config.errorHandler = originalHandler
+ expect(handler.calls.count()).toBe(1)
19
done()
20
21
0 commit comments