Merge rebased aircraft emergency contribution for HAL-522 validation

# Conflicts:
#	DATA_SOURCES.md
This commit is contained in:
Mazeyar Moeini Feizabadi committed 2026-10-13 17:25:47 +02:00
commit 69e8b18e02
31 files changed
+1448 -1207

No files matched your search

+5
View File
@@ -30,6 +30,9 @@ export function normalizeOpenSkyAircraft(row) {
typeCode: null,
registration: null,
operator: null,
squawk: cleanText(row[14]) || null,
// State vectors carry no ADS-B emergency field; the squawk stands alone.
emergency: null,
};
}
@@ -68,6 +71,8 @@ export function normalizeReadsbAircraft(row, snapshotTimeMs) {
typeCode: cleanText(row.t),
registration: cleanText(row.r),
operator: cleanText(row.ownOp),
squawk: cleanText(row.squawk) || null,
emergency: cleanText(row.emergency).toLowerCase() || null,
};
}
+20
View File
@@ -313,3 +313,23 @@ test('identity lookup validates its response and honors body-parse cancellation'
name: 'AbortError',
});
});
test('transponder squawk and ADS-B emergency status are carried, blanks stay null', () => {
const squawking = [...aircraft, '7700'];
const civil = openSkySnapshot({ states: [squawking] }, { now }).records[0];
assert.equal(civil.squawk, '7700');
assert.equal(civil.emergency, null);
assert.equal(openSkySnapshot({ states: [aircraft] }).records[0].squawk, null);
const mil = normalizeReadsbAircraft(
{ hex: 'abc123', lat: 30, lon: -97, squawk: '7600', emergency: 'NORDO' },
now,
);
assert.equal(mil.squawk, '7600');
assert.equal(mil.emergency, 'nordo');
const quiet = normalizeReadsbAircraft(
{ hex: 'abc123', lat: 30, lon: -97 },
now,
);
assert.equal(quiet.squawk, null);
assert.equal(quiet.emergency, null);
});