Skip to content

Commit 13d62d8

Browse files
committed
Fix 6 TS errors in base.spec.ts - Mock parser signatures & property access
- Lines 315-317: Added SystemFeature return type to mock parser methods (parseGeoJSON, parseSensorML, parseSWE) - Line 326: Added SystemFeature return type to ErrorThrowingParser.parseGeoJSON() - Line 371: Fixed property access from result.length to result.data.length - Line 387: Removed invalid 'format' property from ParserOptions Resolves Sam-Bolling/CSAPI-Live-Testing#77
1 parent f82ce24 commit 13d62d8

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/ogc-api/csapi/parsers/base.spec.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -312,9 +312,9 @@ describe('CSAPIParser', () => {
312312
it('should throw CSAPIParseError on parseJSON fallback failure', () => {
313313
// Create a parser that fails all format parsers
314314
class FailingParser extends SystemParser {
315-
parseGeoJSON() { throw new Error('GeoJSON failed'); }
316-
parseSensorML() { throw new Error('SensorML failed'); }
317-
parseSWE() { throw new Error('SWE failed'); }
315+
parseGeoJSON(): SystemFeature { throw new Error('GeoJSON failed'); }
316+
parseSensorML(): SystemFeature { throw new Error('SensorML failed'); }
317+
parseSWE(): SystemFeature { throw new Error('SWE failed'); }
318318
}
319319

320320
const failingParser = new FailingParser();
@@ -323,7 +323,7 @@ describe('CSAPIParser', () => {
323323

324324
it('should re-throw CSAPIParseError without wrapping', () => {
325325
class ErrorThrowingParser extends SystemParser {
326-
parseGeoJSON() {
326+
parseGeoJSON(): SystemFeature {
327327
throw new CSAPIParseError('Custom parse error', 'geojson');
328328
}
329329
}
@@ -368,7 +368,7 @@ describe('CSAPIParser', () => {
368368
// In strict mode, validation errors should propagate
369369
expect(() => {
370370
const result = parser.parse(invalidData);
371-
if (result && result.length > 0 && 'errors' in (result as any)) {
371+
if (result && result.data.length > 0 && 'errors' in (result as any)) {
372372
throw new Error('Validation failed');
373373
}
374374
}).not.toThrow();
@@ -384,7 +384,7 @@ describe('CSAPIParser', () => {
384384
geometry: null,
385385
};
386386

387-
const result = parser.parse(data, { format: 'json' });
387+
const result = parser.parse(data);
388388
expect(result).toBeDefined();
389389
});
390390

0 commit comments

Comments
 (0)