Run upstream's HUD summary and standalone startup tests against the engine-based HUD and application

This commit is contained in:
German Khokhlov committed 2026-11-03 15:36:11 +04:00
1 parent 1a1eef0e5c
commit 7f0572cf4c
2 files changed
+8 -3

No files matched your search

+3 -1
View File
@@ -2,6 +2,7 @@ import { test } from 'node:test';
import assert from 'node:assert/strict';
import './testSupport/stubMgrs.mjs';
import { hudReadouts } from './testSupport/hudReadouts.mjs';
import { viewerEngine } from './testSupport/viewerEngine.mjs';
const { IntelHUD } = await import('./hud.js');
const { setLocale } = await import('./i18n/index.js');
@@ -49,7 +50,8 @@ function createHud(
},
};
const sent = [];
const hud = new IntelHUD(viewer, {
const hud = new IntelHUD(viewerEngine(viewer), {
viewer,
publish,
summaryService: {
configured: async () => true,
+5 -2
View File
@@ -59,7 +59,9 @@ async function standaloneStartup(Cesium, credentials, fetchImpl) {
)
// Imports may span lines (`import {\n a,\n b,\n} from '…';`).
.replace(/^import [^;]*;\n/gm, '')
.replace(/^export /gm, '');
.replace(/^export /gm, '')
// A classic script has no import.meta; the dev-only branches stay off.
.replace(/import\.meta\.env/g, '({}).env');
const context = vm.createContext({
document: {
getElementById: () => ({ querySelector: () => ({}) }),
@@ -72,7 +74,8 @@ async function standaloneStartup(Cesium, credentials, fetchImpl) {
applyDocumentLanguage() {},
applyDocumentTranslations() {},
CITY_POIS: [],
createApplication: (options) => options,
createApplication: (options) => ({ ...options, subscribe() {} }),
resolveEngineKind: () => 'cesium',
createStandalonePlaceSearch: () => ({}),
createStandaloneCatalog: () => ({}),
createGoogleTokenSource: () => createGoogleTokenSource({ fetchImpl }),