@geospatial-sdk/geocoding 0.0.5-dev.50 → 0.0.5-dev.52
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -38,7 +38,7 @@ const RESULTS_FIXTURE: DataGouvFrResponse = {
|
|
|
38
38
|
limit: 1,
|
|
39
39
|
};
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
globalThis.fetch = vi.fn(() =>
|
|
42
42
|
Promise.resolve({
|
|
43
43
|
json: () => Promise.resolve(RESULTS_FIXTURE),
|
|
44
44
|
} as Response),
|
|
@@ -72,7 +72,7 @@ describe("queryDataGouvFr", () => {
|
|
|
72
72
|
results = await queryDataGouvFr("hello world");
|
|
73
73
|
});
|
|
74
74
|
it("uses default options", () => {
|
|
75
|
-
expect(
|
|
75
|
+
expect(globalThis.fetch).toHaveBeenCalledWith(
|
|
76
76
|
"https://api-adresse.data.gouv.fr/search/?q=hello+world",
|
|
77
77
|
);
|
|
78
78
|
});
|
|
@@ -87,7 +87,7 @@ describe("queryDataGouvFr", () => {
|
|
|
87
87
|
});
|
|
88
88
|
});
|
|
89
89
|
it("uses given options", () => {
|
|
90
|
-
expect(
|
|
90
|
+
expect(globalThis.fetch).toHaveBeenCalledWith(
|
|
91
91
|
"https://api-adresse.data.gouv.fr/search/?q=hello+world&limit=32&type=street&postcode=00000&citycode=12345",
|
|
92
92
|
);
|
|
93
93
|
});
|
|
@@ -57,7 +57,7 @@ const RESULTS_FIXTURE: GeoadminResponse = {
|
|
|
57
57
|
],
|
|
58
58
|
};
|
|
59
59
|
|
|
60
|
-
|
|
60
|
+
globalThis.fetch = vi.fn(() =>
|
|
61
61
|
Promise.resolve({
|
|
62
62
|
json: () => Promise.resolve(RESULTS_FIXTURE),
|
|
63
63
|
} as Response),
|
|
@@ -114,7 +114,7 @@ describe("queryGeoadmin", () => {
|
|
|
114
114
|
results = await queryGeoadmin("hello world");
|
|
115
115
|
});
|
|
116
116
|
it("uses default options", () => {
|
|
117
|
-
expect(
|
|
117
|
+
expect(globalThis.fetch).toHaveBeenCalledWith(
|
|
118
118
|
"https://api3.geo.admin.ch/rest/services/api/SearchServer?geometryFormat=geojson&type=locations&searchText=hello+world&lang=en&sr=4326&origins=zipcode%2Cgg25",
|
|
119
119
|
);
|
|
120
120
|
});
|
|
@@ -130,7 +130,7 @@ describe("queryGeoadmin", () => {
|
|
|
130
130
|
});
|
|
131
131
|
});
|
|
132
132
|
it("uses given options", () => {
|
|
133
|
-
expect(
|
|
133
|
+
expect(globalThis.fetch).toHaveBeenCalledWith(
|
|
134
134
|
"https://api3.geo.admin.ch/rest/services/api/SearchServer?geometryFormat=geojson&type=locations&searchText=hello+world&lang=de&sr=21781&limit=32&origins=district%2Caddress",
|
|
135
135
|
);
|
|
136
136
|
});
|
|
@@ -146,7 +146,7 @@ describe("queryGeoadmin", () => {
|
|
|
146
146
|
});
|
|
147
147
|
});
|
|
148
148
|
it("uses given options", () => {
|
|
149
|
-
expect(
|
|
149
|
+
expect(globalThis.fetch).toHaveBeenCalledWith(
|
|
150
150
|
"https://api3.geo.admin.ch/rest/services/api/SearchServer?geometryFormat=geojson&type=featuresearch&searchText=hello+world&lang=de&sr=21781&limit=32&features=abc%2Cdef",
|
|
151
151
|
);
|
|
152
152
|
});
|
|
@@ -161,7 +161,7 @@ describe("queryGeoadmin", () => {
|
|
|
161
161
|
});
|
|
162
162
|
});
|
|
163
163
|
it("uses given options", () => {
|
|
164
|
-
expect(
|
|
164
|
+
expect(globalThis.fetch).toHaveBeenCalledWith(
|
|
165
165
|
"https://api3.geo.admin.ch/rest/services/api/SearchServer?geometryFormat=geojson&type=layers&searchText=hello+world&lang=de&sr=21781&limit=32",
|
|
166
166
|
);
|
|
167
167
|
});
|
|
@@ -90,7 +90,7 @@ describe("queryGeonames", () => {
|
|
|
90
90
|
results = await queryGeonames("Zurich");
|
|
91
91
|
});
|
|
92
92
|
it("uses default options", () => {
|
|
93
|
-
expect(
|
|
93
|
+
expect(globalThis.fetch).toHaveBeenCalledWith(
|
|
94
94
|
expect.stringContaining(
|
|
95
95
|
"https://secure.geonames.org/searchJSON?q=Zurich&username=gn_ui&maxRows=10",
|
|
96
96
|
),
|
|
@@ -108,7 +108,7 @@ describe("queryGeonames", () => {
|
|
|
108
108
|
});
|
|
109
109
|
});
|
|
110
110
|
it("uses given options for custom search", () => {
|
|
111
|
-
expect(
|
|
111
|
+
expect(globalThis.fetch).toHaveBeenCalledWith(
|
|
112
112
|
expect.stringContaining(
|
|
113
113
|
"https://secure.geonames.org/searchJSON?q=Zurich&username=customUser&maxRows=5&country=CH&lang=de&style=FULL&type=json",
|
|
114
114
|
),
|
|
@@ -127,7 +127,7 @@ describe("queryGeonames", () => {
|
|
|
127
127
|
});
|
|
128
128
|
});
|
|
129
129
|
it("uses given options for bounding box search", () => {
|
|
130
|
-
expect(
|
|
130
|
+
expect(globalThis.fetch).toHaveBeenCalledWith(
|
|
131
131
|
expect.stringContaining(
|
|
132
132
|
"https://secure.geonames.org/searchJSON?q=Zurich&username=customUser&maxRows=10&lang=en&style=FULL&type=json&east=10&west=5&north=50&south=45",
|
|
133
133
|
),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geospatial-sdk/geocoding",
|
|
3
|
-
"version": "0.0.5-dev.
|
|
3
|
+
"version": "0.0.5-dev.52+73ea489",
|
|
4
4
|
"description": "Geocoding-related components",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"geocoding"
|
|
@@ -32,5 +32,5 @@
|
|
|
32
32
|
"bugs": {
|
|
33
33
|
"url": "https://github.com/jahow/geospatial-sdk/issues"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "73ea4890e493aae5379e23af6b7679bab253db92"
|
|
36
36
|
}
|