feat: migrate platform login scenes and native login flows
This commit is contained in:
@@ -7,7 +7,9 @@ import {
|
||||
resolveLocalStartup,
|
||||
type LocalStartupContext,
|
||||
} from '../../YouleNexus/assets/framework/config/local-startup.ts';
|
||||
import { STARTUP_CONFIG } from '../../YouleNexus/assets/framework/config/profiles.ts';
|
||||
import { STARTUP_CONFIG as EDITABLE_STARTUP_CONFIG } from '../../YouleNexus/assets/framework/config/profiles.ts';
|
||||
// 固定测试来源,允许开发者独立切换项目的 local/remote 开关。
|
||||
const STARTUP_CONFIG = Object.freeze({...EDITABLE_STARTUP_CONFIG, configSource:'remote' as const});
|
||||
import type { ResolveRuntimeConfigOptions, RuntimeConfig } from '../../YouleNexus/assets/framework/config/runtime-config.ts';
|
||||
import type { ConfigFetcher } from '../../YouleNexus/assets/framework/config/remote-config.ts';
|
||||
import { BUILD_IDENTITY } from '../../YouleNexus/assets/framework/config/sources/defaults.ts';
|
||||
@@ -22,7 +24,7 @@ function options(search = ''): ResolveRuntimeConfigOptions & {
|
||||
return { player_server_tcp: 'remote.example:3088' };
|
||||
},
|
||||
};
|
||||
return { hostKind: 'h5', win: {}, search, fetcher };
|
||||
return { startupConfig:STARTUP_CONFIG, hostKind: 'h5', win: {}, search, fetcher };
|
||||
}
|
||||
|
||||
test('local debug fetches remote config before choosing authoritative local servers', async () => {
|
||||
@@ -174,3 +176,12 @@ test('local consumers validate the injected source snapshot and its exact target
|
||||
assert.throws(()=>assertLocalStartupContext({...context,config:{...context.config,startupConfig:{...context.config.startupConfig,...patch}}} as any),/mode|useLocalServer|localServers|gameserver/);
|
||||
}
|
||||
});
|
||||
|
||||
test('local startup validates the selected project txt source', async () => {
|
||||
const localFetcher={async fetch(){return {showVisitor:1};}};
|
||||
const context=await resolveLocalStartup({startupConfig:{...STARTUP_CONFIG,configSource:'local'},hostKind:'h5',win:{},search:'',
|
||||
fetcher:{async fetch(){throw Error('remote forbidden');}},localFetcher});
|
||||
assert.equal(context.config.source,'local');
|
||||
assert.equal(context.config.gameserver,STARTUP_CONFIG.localConfigResource);
|
||||
assert.doesNotThrow(()=>assertLocalStartupContext(context));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user