mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-06 11:24:00 +00:00
Run upstream's HUD summary and standalone startup tests against the engine-based HUD and application
This commit is contained in:
1 parent
1a1eef0e5c
commit
7f0572cf4c
2 files changed
+8
-3
No files matched your search
@@ -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,
|
||||
|
||||
@@ -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 }),
|
||||
|
||||
Reference in new issue
Block a user