Skip to content

Commit 1e84be5

Browse files
committed
Format
1 parent ec89b9f commit 1e84be5

File tree

2 files changed

+87
-24
lines changed

2 files changed

+87
-24
lines changed

packages/instant-meilisearch/__tests__/assets/utils.ts

Lines changed: 80 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -104,121 +104,181 @@ const geoDataset = [
104104
id: '1',
105105
city: 'Lille',
106106
_geo: { lat: 50.629973371633746, lng: 3.056944739941957 },
107-
_geojson: { type: 'Point', coordinates: [3.056944739941957, 50.629973371633746] },
107+
_geojson: {
108+
type: 'Point',
109+
coordinates: [3.056944739941957, 50.629973371633746],
110+
},
108111
},
109112
{
110113
id: '2',
111114
city: 'Mons-en-Barœul',
112115
_geo: { lat: 50.64158612012105, lng: 3.110659348034867 },
113-
_geojson: { type: 'Point', coordinates: [3.110659348034867, 50.64158612012105] },
116+
_geojson: {
117+
type: 'Point',
118+
coordinates: [3.110659348034867, 50.64158612012105],
119+
},
114120
},
115121
{
116122
id: '3',
117123
city: 'Hellemmes',
118124
_geo: { lat: 50.63122096551808, lng: 3.1106399673339933 },
119-
_geojson: { type: 'Point', coordinates: [3.1106399673339933, 50.63122096551808] },
125+
_geojson: {
126+
type: 'Point',
127+
coordinates: [3.1106399673339933, 50.63122096551808],
128+
},
120129
},
121130
{
122131
id: '4',
123132
city: "Villeneuve-d'Ascq",
124133
_geo: { lat: 50.622468098014565, lng: 3.147642551343714 },
125-
_geojson: { type: 'Point', coordinates: [3.147642551343714, 50.622468098014565] },
134+
_geojson: {
135+
type: 'Point',
136+
coordinates: [3.147642551343714, 50.622468098014565],
137+
},
126138
},
127139
{
128140
id: '5',
129141
city: 'Hem',
130142
_geo: { lat: 50.655250871381355, lng: 3.189729726624413 },
131-
_geojson: { type: 'Point', coordinates: [3.189729726624413, 50.655250871381355] },
143+
_geojson: {
144+
type: 'Point',
145+
coordinates: [3.189729726624413, 50.655250871381355],
146+
},
132147
},
133148
{
134149
id: '6',
135150
city: 'Roubaix',
136151
_geo: { lat: 50.69247345189671, lng: 3.176332673774765 },
137-
_geojson: { type: 'Point', coordinates: [3.176332673774765, 50.69247345189671] },
152+
_geojson: {
153+
type: 'Point',
154+
coordinates: [3.176332673774765, 50.69247345189671],
155+
},
138156
},
139157
{
140158
id: '7',
141159
city: 'Tourcoing',
142160
_geo: { lat: 50.72639746673648, lng: 3.154165365957867 },
143-
_geojson: { type: 'Point', coordinates: [3.154165365957867, 50.72639746673648] },
161+
_geojson: {
162+
type: 'Point',
163+
coordinates: [3.154165365957867, 50.72639746673648],
164+
},
144165
},
145166
{
146167
id: '8',
147168
city: 'Mouscron',
148169
_geo: { lat: 50.74532555490861, lng: 3.2206407854429853 },
149-
_geojson: { type: 'Point', coordinates: [3.2206407854429853, 50.74532555490861] },
170+
_geojson: {
171+
type: 'Point',
172+
coordinates: [3.2206407854429853, 50.74532555490861],
173+
},
150174
},
151175
{
152176
id: '9',
153177
city: 'Tournai',
154178
_geo: { lat: 50.60534252860263, lng: 3.3758586941351414 },
155-
_geojson: { type: 'Point', coordinates: [3.3758586941351414, 50.60534252860263] },
179+
_geojson: {
180+
type: 'Point',
181+
coordinates: [3.3758586941351414, 50.60534252860263],
182+
},
156183
},
157184
{
158185
id: '10',
159186
city: 'Ghent',
160187
_geo: { lat: 51.053777403679035, lng: 3.695773311992693 },
161-
_geojson: { type: 'Point', coordinates: [3.695773311992693, 51.053777403679035] },
188+
_geojson: {
189+
type: 'Point',
190+
coordinates: [3.695773311992693, 51.053777403679035],
191+
},
162192
},
163193
{
164194
id: '11',
165195
city: 'Brussels',
166196
_geo: { lat: 50.84664097454469, lng: 4.337066356428184 },
167-
_geojson: { type: 'Point', coordinates: [4.337066356428184, 50.84664097454469] },
197+
_geojson: {
198+
type: 'Point',
199+
coordinates: [4.337066356428184, 50.84664097454469],
200+
},
168201
},
169202
{
170203
id: '12',
171204
city: 'Charleroi',
172205
_geo: { lat: 50.40957013888948, lng: 4.434735431508552 },
173-
_geojson: { type: 'Point', coordinates: [4.434735431508552, 50.40957013888948] },
206+
_geojson: {
207+
type: 'Point',
208+
coordinates: [4.434735431508552, 50.40957013888948],
209+
},
174210
},
175211
{
176212
id: '13',
177213
city: 'Mons',
178214
_geo: { lat: 50.45029417885542, lng: 3.962372287090469 },
179-
_geojson: { type: 'Point', coordinates: [3.962372287090469, 50.45029417885542] },
215+
_geojson: {
216+
type: 'Point',
217+
coordinates: [3.962372287090469, 50.45029417885542],
218+
},
180219
},
181220
{
182221
id: '14',
183222
city: 'Valenciennes',
184223
_geo: { lat: 50.351817774473545, lng: 3.53262836469288 },
185-
_geojson: { type: 'Point', coordinates: [3.53262836469288, 50.351817774473545] },
224+
_geojson: {
225+
type: 'Point',
226+
coordinates: [3.53262836469288, 50.351817774473545],
227+
},
186228
},
187229
{
188230
id: '15',
189231
city: 'Arras',
190232
_geo: { lat: 50.28448752857995, lng: 2.763751584447816 },
191-
_geojson: { type: 'Point', coordinates: [2.763751584447816, 50.28448752857995] },
233+
_geojson: {
234+
type: 'Point',
235+
coordinates: [2.763751584447816, 50.28448752857995],
236+
},
192237
},
193238
{
194239
id: '16',
195240
city: 'Cambrai',
196241
_geo: { lat: 50.1793405779067, lng: 3.218940995250293 },
197-
_geojson: { type: 'Point', coordinates: [3.218940995250293, 50.1793405779067] },
242+
_geojson: {
243+
type: 'Point',
244+
coordinates: [3.218940995250293, 50.1793405779067],
245+
},
198246
},
199247
{
200248
id: '17',
201249
city: 'Bapaume',
202250
_geo: { lat: 50.1112761272364, lng: 2.854789466608312 },
203-
_geojson: { type: 'Point', coordinates: [2.854789466608312, 50.1112761272364] },
251+
_geojson: {
252+
type: 'Point',
253+
coordinates: [2.854789466608312, 50.1112761272364],
254+
},
204255
},
205256
{
206257
id: '18',
207258
city: 'Amiens',
208259
_geo: { lat: 49.931472529669996, lng: 2.271049975831708 },
209-
_geojson: { type: 'Point', coordinates: [2.271049975831708, 49.931472529669996] },
260+
_geojson: {
261+
type: 'Point',
262+
coordinates: [2.271049975831708, 49.931472529669996],
263+
},
210264
},
211265
{
212266
id: '19',
213267
city: 'Compiègne',
214268
_geo: { lat: 49.444980887725656, lng: 2.7913841281529015 },
215-
_geojson: { type: 'Point', coordinates: [2.7913841281529015, 49.444980887725656] },
269+
_geojson: {
270+
type: 'Point',
271+
coordinates: [2.7913841281529015, 49.444980887725656],
272+
},
216273
},
217274
{
218275
id: '20',
219276
city: 'Paris',
220277
_geo: { lat: 48.90210006089548, lng: 2.370840086740693 },
221-
_geojson: { type: 'Point', coordinates: [2.370840086740693, 48.90210006089548] },
278+
_geojson: {
279+
type: 'Point',
280+
coordinates: [2.370840086740693, 48.90210006089548],
281+
},
222282
},
223283
]
224284

packages/instant-meilisearch/__tests__/geosearch.test.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ describe('Instant Meilisearch Browser test', () => {
119119
insidePolygon: [
120120
[50.95, 4.1],
121121
[50.75, 4.6],
122-
[50.70, 4.2],
122+
[50.7, 4.2],
123123
],
124124
},
125125
},
@@ -140,7 +140,7 @@ describe('Instant Meilisearch Browser test', () => {
140140
{
141141
id: 'geo-only',
142142
city: 'GeoOnly',
143-
_geo: { lat: 50.80, lng: 4.35 },
143+
_geo: { lat: 50.8, lng: 4.35 },
144144
},
145145
])
146146
.waitTask()
@@ -153,7 +153,7 @@ describe('Instant Meilisearch Browser test', () => {
153153
insidePolygon: [
154154
[50.95, 4.1],
155155
[50.75, 4.6],
156-
[50.70, 4.2],
156+
[50.7, 4.2],
157157
],
158158
},
159159
},
@@ -164,7 +164,10 @@ describe('Instant Meilisearch Browser test', () => {
164164
expect(hits.find((h: any) => h.city === 'GeoOnly')).toBeFalsy()
165165

166166
// Cleanup
167-
await meilisearchClient.index('geotest').deleteDocument('geo-only').waitTask()
167+
await meilisearchClient
168+
.index('geotest')
169+
.deleteDocument('geo-only')
170+
.waitTask()
168171
})
169172

170173
test('aroundRadius matches _geojson-only documents', async () => {

0 commit comments

Comments
 (0)