33// This file is licensed under the MIT License.
44// License text available at https://opensource.org/licenses/MIT
55
6- import { expect } from '@loopback/testlab' ;
6+ import { expect , skipIf } from '@loopback/testlab' ;
77import { GeocoderDataSource } from '../../../datasources' ;
88import { Geocoder , GeocoderProvider } from '../../../services' ;
99import {
@@ -14,32 +14,37 @@ import {
1414 isGeoCoderServiceAvailable ,
1515} from '../../helpers' ;
1616
17- describe ( 'GeoLookupService' , function ( this : Mocha . Suite ) {
18- this . timeout ( 30 * 1000 ) ;
17+ skipIf < [ ( this : Mocha . Suite ) => void ] , void > (
18+ process . platform === 'win32' ,
19+ describe ,
20+ 'GeoLookupService' ,
21+ function ( this : Mocha . Suite ) {
22+ this . timeout ( 30 * 1000 ) ;
1923
20- let cachingProxy : HttpCachingProxy ;
21- before ( async ( ) => ( cachingProxy = await givenCachingProxy ( ) ) ) ;
22- after ( ( ) => cachingProxy . stop ( ) ) ;
24+ let cachingProxy : HttpCachingProxy ;
25+ before ( async ( ) => ( cachingProxy = await givenCachingProxy ( ) ) ) ;
26+ after ( ( ) => cachingProxy . stop ( ) ) ;
2327
24- let service : Geocoder ;
25- before ( givenGeoService ) ;
28+ let service : Geocoder ;
29+ before ( givenGeoService ) ;
2630
27- let available = true ;
28- before ( async ( ) => {
29- available = await isGeoCoderServiceAvailable ( service ) ;
30- } ) ;
31+ let available = true ;
32+ before ( async ( ) => {
33+ available = await isGeoCoderServiceAvailable ( service ) ;
34+ } ) ;
3135
32- it ( 'resolves an address to a geo point' , async function ( this : Mocha . Context ) {
33- if ( ! available ) return this . skip ( ) ;
36+ it ( 'resolves an address to a geo point' , async function ( this : Mocha . Context ) {
37+ if ( ! available ) return this . skip ( ) ;
3438
35- const points = await service . geocode ( aLocation . address ) ;
39+ const points = await service . geocode ( aLocation . address ) ;
3640
37- expect ( points ) . to . deepEqual ( [ aLocation . geopoint ] ) ;
38- } ) ;
41+ expect ( points ) . to . deepEqual ( [ aLocation . geopoint ] ) ;
42+ } ) ;
3943
40- async function givenGeoService ( ) {
41- const config = getProxiedGeoCoderConfig ( cachingProxy ) ;
42- const dataSource = new GeocoderDataSource ( config ) ;
43- service = await new GeocoderProvider ( dataSource ) . value ( ) ;
44- }
45- } ) ;
44+ async function givenGeoService ( ) {
45+ const config = getProxiedGeoCoderConfig ( cachingProxy ) ;
46+ const dataSource = new GeocoderDataSource ( config ) ;
47+ service = await new GeocoderProvider ( dataSource ) . value ( ) ;
48+ }
49+ } ,
50+ ) ;
0 commit comments