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:
+5
-5
@@ -966,22 +966,22 @@
|
||||
otherRemarks: new Set(),
|
||||
};
|
||||
|
||||
metars.forEach(metarString => {
|
||||
metars.forEach(metarData => {
|
||||
const tempLogs = [];
|
||||
console.log = (...args) => {
|
||||
tempLogs.push(args.join(' '));
|
||||
};
|
||||
|
||||
try {
|
||||
const sections = generateMetarSections(metarString);
|
||||
if (sections.length === 0 && metarString.length > 0) {
|
||||
const sections = generateMetarSections(metarData.metar);
|
||||
if (sections.length === 0 && metarData.metar.length > 0) {
|
||||
throw new Error("Parser produced no sections");
|
||||
}
|
||||
|
||||
const hasUnknowns = tempLogs.some(msg => msg.includes('Unknown') || msg.includes('Other remark'));
|
||||
if (hasUnknowns) {
|
||||
withUnknowns++;
|
||||
originalConsoleLog(`METAR with decoding issues: ${metarString}`);
|
||||
originalConsoleLog(`METAR with decoding issues: ${metarData.metar}`);
|
||||
tempLogs.forEach(msg => {
|
||||
originalConsoleLog(` -> ${msg}`);
|
||||
if (msg.startsWith('Unknown Airport code:')) {
|
||||
@@ -1004,7 +1004,7 @@
|
||||
}
|
||||
|
||||
} catch (e) {
|
||||
console.error("Failed to parse:", metarString, e);
|
||||
console.error("Failed to parse:", metarData, e);
|
||||
failed++;
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user