mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-18 01:02:23 +00:00
Aircraft icons are one size; helicopters turn a three-frame rotor while airborne or moving; ADS-B ground vehicles share one amber sprite and stations/obstacles one mast; vessels get hull sprites by type and one buoy. Going live keeps contacts until the first live answer and replaces them by id; fast playback holds before the loaded positions end and prefetches ahead. Cesium models move their parts from the optional model part state.
22 lines
791 B
JavaScript
22 lines
791 B
JavaScript
import test from 'node:test';
|
|
import assert from 'node:assert/strict';
|
|
import { readFileSync } from 'node:fs';
|
|
|
|
const source = (layer) =>
|
|
readFileSync(new URL(`../${layer}/tracking.js`, import.meta.url), 'utf8');
|
|
|
|
for (const layer of ['military', 'flights']) {
|
|
test(`${layer}: a tracked ground station's mast is never turned`, () => {
|
|
// The tracked billboard's rotation answers 0 for a station before any
|
|
// course is projected on screen.
|
|
const rotation = /rotation: \(\) => \{[\s\S]*?courseScreenRotation\(/.exec(
|
|
source(layer),
|
|
)?.[0];
|
|
assert.ok(rotation, 'the tracked billboard turns by a rotation callback');
|
|
assert.match(
|
|
rotation,
|
|
/if \(tracked\.klass === 'station'\) return 0;\s*const projected = courseScreenRotation\(/,
|
|
);
|
|
});
|
|
}
|