File tree Expand file tree Collapse file tree 1 file changed +13
-8
lines changed
tests/unit/specs/components/geocoder Expand file tree Collapse file tree 1 file changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -289,14 +289,19 @@ describe('geocoder/Geocoder.vue', () => {
289289 expect ( vm . onQueryResults ) . to . be . a ( 'function' ) ;
290290 } ) ;
291291
292- it ( 'GeoCoderController calls remote service' , done => {
293- vm . geocoderController . query ( queryString ) . then ( results => {
294- expect ( results ) . to . not . be . undefined ;
295- expect ( results ) . to . not . be . empty ;
296- expect ( results [ 0 ] . address . road ) . to . equal ( 'Heerstraße' ) ;
297- done ( ) ;
298- } ) ;
299- } ) ;
292+ it ( 'GeoCoderController calls remote service' , async function ( ) {
293+ try {
294+ const result = await vm . geocoderController . query ( queryString ) ;
295+ expect ( result ) . to . not . be . undefined ;
296+ expect ( result ) . to . not . be . empty ;
297+ expect ( result [ 0 ] . address . road ) . to . equal ( 'Heerstraße' ) ;
298+ } catch ( error ) {
299+ if ( error . code === 'ERR_NETWORK' || error . code === 'ECONNREFUSED' || error . code === 'ECONNABORTED' || error . message . includes ( 'Network' ) ) {
300+ this . skip ( ) ;
301+ }
302+ throw error ; // real failures still fail the test
303+ }
304+ } ) . timeout ( 16000 ) ; // timeout is 15 secs, so we make test timeout to 16 secs here (to be sure)
300305
301306 it ( 'search method assigns last query string' , async ( ) => {
302307 applyAxiosMock ( ) ;
You can’t perform that action at this time.
0 commit comments