fix: Access .metar property from data object in testAllMetars

Co-authored-by: aider (gemini/gemini-2.5-pro) <aider@aider.chat>
This commit is contained in:
2026-02-14 18:18:11 -07:00
parent d36a6999e2
commit 3015e43787
+5 -5
View File
@@ -966,22 +966,22 @@
otherRemarks: new Set(), otherRemarks: new Set(),
}; };
metars.forEach(metarString => { metars.forEach(metarData => {
const tempLogs = []; const tempLogs = [];
console.log = (...args) => { console.log = (...args) => {
tempLogs.push(args.join(' ')); tempLogs.push(args.join(' '));
}; };
try { try {
const sections = generateMetarSections(metarString); const sections = generateMetarSections(metarData.metar);
if (sections.length === 0 && metarString.length > 0) { if (sections.length === 0 && metarData.metar.length > 0) {
throw new Error("Parser produced no sections"); throw new Error("Parser produced no sections");
} }
const hasUnknowns = tempLogs.some(msg => msg.includes('Unknown') || msg.includes('Other remark')); const hasUnknowns = tempLogs.some(msg => msg.includes('Unknown') || msg.includes('Other remark'));
if (hasUnknowns) { if (hasUnknowns) {
withUnknowns++; withUnknowns++;
originalConsoleLog(`METAR with decoding issues: ${metarString}`); originalConsoleLog(`METAR with decoding issues: ${metarData.metar}`);
tempLogs.forEach(msg => { tempLogs.forEach(msg => {
originalConsoleLog(` -> ${msg}`); originalConsoleLog(` -> ${msg}`);
if (msg.startsWith('Unknown Airport code:')) { if (msg.startsWith('Unknown Airport code:')) {
@@ -1004,7 +1004,7 @@
} }
} catch (e) { } catch (e) {
console.error("Failed to parse:", metarString, e); console.error("Failed to parse:", metarData, e);
failed++; failed++;
} }
}); });