mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-12 06:12:18 +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 assert from 'node:assert/strict';
|
||||||
import './testSupport/stubMgrs.mjs';
|
import './testSupport/stubMgrs.mjs';
|
||||||
import { hudReadouts } from './testSupport/hudReadouts.mjs';
|
import { hudReadouts } from './testSupport/hudReadouts.mjs';
|
||||||
|
import { viewerEngine } from './testSupport/viewerEngine.mjs';
|
||||||
|
|
||||||
const { IntelHUD } = await import('./hud.js');
|
const { IntelHUD } = await import('./hud.js');
|
||||||
const { setLocale } = await import('./i18n/index.js');
|
const { setLocale } = await import('./i18n/index.js');
|
||||||
@@ -49,7 +50,8 @@ function createHud(
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
const sent = [];
|
const sent = [];
|
||||||
const hud = new IntelHUD(viewer, {
|
const hud = new IntelHUD(viewerEngine(viewer), {
|
||||||
|
viewer,
|
||||||
publish,
|
publish,
|
||||||
summaryService: {
|
summaryService: {
|
||||||
configured: async () => true,
|
configured: async () => true,
|
||||||
|
|||||||
@@ -59,7 +59,9 @@ async function standaloneStartup(Cesium, credentials, fetchImpl) {
|
|||||||
)
|
)
|
||||||
// Imports may span lines (`import {\n a,\n b,\n} from '…';`).
|
// Imports may span lines (`import {\n a,\n b,\n} from '…';`).
|
||||||
.replace(/^import [^;]*;\n/gm, '')
|
.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({
|
const context = vm.createContext({
|
||||||
document: {
|
document: {
|
||||||
getElementById: () => ({ querySelector: () => ({}) }),
|
getElementById: () => ({ querySelector: () => ({}) }),
|
||||||
@@ -72,7 +74,8 @@ async function standaloneStartup(Cesium, credentials, fetchImpl) {
|
|||||||
applyDocumentLanguage() {},
|
applyDocumentLanguage() {},
|
||||||
applyDocumentTranslations() {},
|
applyDocumentTranslations() {},
|
||||||
CITY_POIS: [],
|
CITY_POIS: [],
|
||||||
createApplication: (options) => options,
|
createApplication: (options) => ({ ...options, subscribe() {} }),
|
||||||
|
resolveEngineKind: () => 'cesium',
|
||||||
createStandalonePlaceSearch: () => ({}),
|
createStandalonePlaceSearch: () => ({}),
|
||||||
createStandaloneCatalog: () => ({}),
|
createStandaloneCatalog: () => ({}),
|
||||||
createGoogleTokenSource: () => createGoogleTokenSource({ fetchImpl }),
|
createGoogleTokenSource: () => createGoogleTokenSource({ fetchImpl }),
|
||||||
|
|||||||
Reference in new issue
Block a user