Skip to content

Commit

Permalink
eslint fixups
Browse files Browse the repository at this point in the history
  • Loading branch information
kstratis committed Sep 21, 2022
1 parent ba5bcb8 commit d0df903
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 96 deletions.
5 changes: 2 additions & 3 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@ name: Issue Template
👋 Hi,
Thanks for taking the time to create an issue.
Thanks for taking the time to create an issue.
This project passed 1 MILLION downloads! I've been maintaining it for 5 years now, and it has consumed a serious amount of my personal time. If you depend on this project, please consider sponsoring me.
This project passed 1 MILLION downloads! I've been maintaining it for 5 years now, and it has consumed a serious amount of my personal time. If you depend on this project, please consider sponsoring me.
https://github.com/sponsors/smeijer
Thanks,
Stephan
-->

38 changes: 20 additions & 18 deletions src/providers/__tests__/googleProvider.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,47 +17,49 @@ describe('GoogleProvider', () => {
// before that data is passed to the callback.
const response = [
{
formatted_address: 'George Maduroplein 1, 2584 RZ Den Haag, Netherlands',
// eslint-disable-next-line @typescript-eslint/camelcase
formatted_address:
'George Maduroplein 1, 2584 RZ Den Haag, Netherlands',
geometry: {
location: {
toJSON: () => {
return {
"lng": 4.2969304,
"lat": 52.0994757,
}
}
lng: 4.2969304,
lat: 52.0994757,
};
},
},
viewport: {
toJSON: () => {
return {
"north": 52.1008246802915,
"east": 4.298279380291502,
"south": 52.0981267197085,
"west": 4.295581419708498,
}
}
}
}
}
north: 52.1008246802915,
east: 4.298279380291502,
south: 52.0981267197085,
west: 4.295581419708498,
};
},
},
},
},
];

jest.spyOn(Loader.prototype, 'load').mockImplementationOnce(async () => {
return {
maps: {
Geocoder: function() {
Geocoder: function () {
this.geocode = async (query, callback) => {
return callback(response, 'OK');
};
}
}
},
},
};
});

const options = {
params: {
key: process.env.GOOGLE_API_KEY,
},
}
};

const geoCoder = await Provider.loadGeocoder(options);
const provider = new Provider(geoCoder);
Expand Down
91 changes: 16 additions & 75 deletions src/providers/__tests__/peliasResponse.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@
},
"querySize": 20
},
"warnings": [
"performance optimization: excluding 'address' layer"
],
"warnings": ["performance optimization: excluding 'address' layer"],
"engine": {
"name": "Pelias",
"author": "Mapzen",
Expand All @@ -56,10 +54,7 @@
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
22.999231,
39.390835
]
"coordinates": [22.999231, 39.390835]
},
"properties": {
"id": "node/2631570458",
Expand Down Expand Up @@ -90,10 +85,7 @@
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
11.539115,
60.908174
]
"coordinates": [11.539115, 60.908174]
},
"properties": {
"id": "node/6341953008",
Expand Down Expand Up @@ -129,10 +121,7 @@
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
30.981907,
-29.939019
]
"coordinates": [30.981907, -29.939019]
},
"properties": {
"id": "polyline:24349300",
Expand All @@ -157,21 +146,13 @@
"continent_gid": "whosonfirst:continent:102191573",
"label": "Pelias Place, NL, South Africa"
},
"bbox": [
30.981231,
-29.93952,
30.982589,
-29.938511
]
"bbox": [30.981231, -29.93952, 30.982589, -29.938511]
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
114.127491,
-21.938032
]
"coordinates": [114.127491, -21.938032]
},
"properties": {
"id": "polyline:23395079",
Expand Down Expand Up @@ -200,21 +181,13 @@
"continent_gid": "whosonfirst:continent:102191583",
"label": "Pelias Street, Exmouth, WA, Australia"
},
"bbox": [
114.124938,
-21.93829,
114.130027,
-21.937611
]
"bbox": [114.124938, -21.93829, 114.130027, -21.937611]
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
123.854135,
9.680108
]
"coordinates": [123.854135, 9.680108]
},
"properties": {
"id": "polyline:21756510",
Expand All @@ -238,21 +211,13 @@
"continent_gid": "whosonfirst:continent:102191569",
"label": "F. Pelias, BO, Philippines"
},
"bbox": [
123.853164,
9.679871,
123.855064,
9.680231
]
"bbox": [123.853164, 9.679871, 123.855064, 9.680231]
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
-61.31722,
-66.05479
]
"coordinates": [-61.31722, -66.05479]
},
"properties": {
"id": "6623050",
Expand Down Expand Up @@ -280,10 +245,7 @@
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
-4.070734,
43.423036
]
"coordinates": [-4.070734, 43.423036]
},
"properties": {
"id": "polyline:10453562",
Expand All @@ -309,21 +271,13 @@
"continent_gid": "whosonfirst:continent:102191581",
"label": "Calle Las Pelías, Suances, CB, Spain"
},
"bbox": [
-4.072311,
43.420791,
-4.06891,
43.425346
]
"bbox": [-4.072311, 43.420791, -4.06891, 43.425346]
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
101.73333,
5.7
]
"coordinates": [101.73333, 5.7]
},
"properties": {
"id": "1309815263",
Expand Down Expand Up @@ -353,21 +307,13 @@
}
}
},
"bbox": [
101.71333,
5.68,
101.75333,
5.72
]
"bbox": [101.71333, 5.68, 101.75333, 5.72]
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
101.73333,
5.7
]
"coordinates": [101.73333, 5.7]
},
"properties": {
"id": "1751307",
Expand Down Expand Up @@ -398,10 +344,5 @@
}
}
],
"bbox": [
-61.31722,
-66.05479,
123.855064,
60.908174
]
"bbox": [-61.31722, -66.05479, 123.855064, 60.908174]
}

0 comments on commit d0df903

Please sign in to comment.