@@ -58,7 +58,9 @@ describe('error handling', () => {
58
58
router . push ( '/foo' ) . catch ( err => {
59
59
expect ( err . type ) . toBe ( NavigationFailureType . duplicated )
60
60
expect ( VueRouter . isNavigationFailure ( err ) ) . toBe ( true )
61
- expect ( VueRouter . isNavigationFailure ( err , NavigationFailureType . duplicated ) ) . toBe ( true )
61
+ expect (
62
+ VueRouter . isNavigationFailure ( err , NavigationFailureType . duplicated )
63
+ ) . toBe ( true )
62
64
done ( )
63
65
} )
64
66
} )
@@ -156,7 +158,10 @@ describe('error handling', () => {
156
158
// https://github.com/vuejs/vue-router/issues/3225
157
159
it ( 'should trigger onReady onSuccess when redirecting' , done => {
158
160
const router = new VueRouter ( {
159
- routes : [ { path : '/' , component : { } } , { path : '/foo' , component : { } } ]
161
+ routes : [
162
+ { path : '/' , component : { } } ,
163
+ { path : '/foo' , component : { } }
164
+ ]
160
165
} )
161
166
162
167
const onError = jasmine . createSpy ( 'onError' )
@@ -177,6 +182,7 @@ describe('error handling', () => {
177
182
. push ( '/' )
178
183
. catch ( pushCatch )
179
184
. finally ( ( ) => {
185
+ expect ( router . currentRoute . path ) . toBe ( '/foo' )
180
186
expect ( onReadyFail ) . not . toHaveBeenCalled ( )
181
187
// in 3.2.0 it was called with undefined
182
188
// expect(pushCatch).not.toHaveBeenCalled()
@@ -188,12 +194,14 @@ describe('error handling', () => {
188
194
189
195
it ( 'should trigger onError if error is thrown inside redirect option' , done => {
190
196
const error = new Error ( 'foo' )
191
- const config = [ {
192
- path : '/oldpath/:part' ,
193
- redirect : ( to ) => {
194
- throw error
197
+ const config = [
198
+ {
199
+ path : '/oldpath/:part' ,
200
+ redirect : to => {
201
+ throw error
202
+ }
195
203
}
196
- } ]
204
+ ]
197
205
198
206
const router = new VueRouter ( {
199
207
routes : config
0 commit comments