mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-15 15:52:21 +00:00
scripts/qa/browser.mjs launches headless Chrome with QA_ANGLE and the shared Chrome lookup; scripts/qa/ready.mjs adds frame, tile and transition readiness and bounded polling; scripts/qa/geometry.mjs hands page evaluations the engine-neutral geometry without dev-only source URLs. CODE-BOUNDARIES gains the rule for new QA scripts.
25 lines
809 B
JavaScript
25 lines
809 B
JavaScript
import test from 'node:test';
|
|
import assert from 'node:assert/strict';
|
|
import vm from 'node:vm';
|
|
import { evaluateWithGeo } from './geometry.mjs';
|
|
|
|
test('page geometry works without source routes or native engine constructors', async () => {
|
|
const page = {
|
|
evaluate: (callback, ...args) =>
|
|
vm.runInNewContext(`(${callback})(...${JSON.stringify(args)})`),
|
|
};
|
|
const result = await evaluateWithGeo(
|
|
page,
|
|
(geo, lon, lat, height) => {
|
|
const point = geo.cartesian3.fromDegrees(lon, lat, height);
|
|
return geo.cartographic.fromCartesian(point);
|
|
},
|
|
23,
|
|
-12,
|
|
650,
|
|
);
|
|
assert.ok(Math.abs(result.longitude - (23 * Math.PI) / 180) < 1e-12);
|
|
assert.ok(Math.abs(result.latitude + (12 * Math.PI) / 180) < 1e-12);
|
|
assert.ok(Math.abs(result.height - 650) < 1e-6);
|
|
});
|