17 lines
764 B
TypeScript
17 lines
764 B
TypeScript
import { test } from 'node:test';
|
|
import assert from 'node:assert/strict';
|
|
import { resolveBootstrap } from '../../YouleNexus/assets/framework/config/bootstrap.ts';
|
|
import type { ConfigFetcher } from '../../YouleNexus/assets/framework/config/remote-config.ts';
|
|
|
|
test('resolveBootstrap:显式 hostKind 透传严格 RuntimeConfig,并保留 profile 元数据', async () => {
|
|
const fetcher: ConfigFetcher = {
|
|
async fetch() { return { player_server_tcp: '5.5.5.5:5000' }; },
|
|
};
|
|
const result = await resolveBootstrap({
|
|
mode: 'debug', hostKind: 'h5', win: {}, search: '?profile=local', fetcher,
|
|
});
|
|
assert.equal(result.source, 'remote');
|
|
assert.equal(result.profile.name, 'local');
|
|
assert.deepEqual(result.servers, ['ws://127.0.0.1:3088']);
|
|
});
|