fix(awareness): wrap north-bound bearings

This commit is contained in:
Rudy Celekli committed 2026-10-25 13:28:23 -04:00
1 parent 496d024431
commit 63866c201a
4 files changed
+26 -2

No files matched your search

@@ -0,0 +1,11 @@
import test from 'node:test';
import assert from 'node:assert/strict';
import { formatAwarenessDirection } from './presentation.js';
test('awareness bearings that round through north read 000, not 360', () => {
assert.equal(formatAwarenessDirection(359.4), '359');
assert.equal(formatAwarenessDirection(359.6), '000');
assert.equal(formatAwarenessDirection(0), '000');
assert.equal(formatAwarenessDirection(-0.4), '000');
assert.equal(formatAwarenessDirection(Number.NaN), '—');
});