Stage guarded Classic migration and native bot adapter
Core tests / core (push) Successful in 29s

This commit is contained in:
Codex
2026-09-25 22:57:11 +02:00
parent 58b2019015
commit 02d21abcbd
17 changed files with 616 additions and 11 deletions
+22
View File
@@ -0,0 +1,22 @@
const {test}=require('node:test');
const assert=require('node:assert/strict');
const {classicCommand,classicMode}=require('../.test-build/classic.js');
const actor={name:'Zaku',autonomy:{managed:true,characterGuid:7,accountId:3}};
test('Classic transport requires explicit backend selection',()=>{
assert.equal(classicMode({}),false);
assert.equal(classicMode({GAME_BACKEND:'cmangos-classic'}),true);
});
test('Classic command rejects absent, zero and unmanaged native identities',()=>{
for(const autonomy of [undefined,{managed:false,characterGuid:7,accountId:3},{managed:true,characterGuid:0,accountId:3},{managed:true,characterGuid:7,accountId:-1}])
assert.throws(()=>classicCommand('intent',{...actor,autonomy},'quest'));
assert.throws(()=>classicCommand('party',actor));
});
test('Classic peer commands bind both accounts and preserve literal speech',()=>{
const peer={name:'Alany',autonomy:{managed:true,characterGuid:8,accountId:4}};
const message='hello "friend"; return 1';
const command=JSON.parse(classicCommand('say',actor,message,peer));
assert.equal(command.argument,message);
assert.equal(command.guid,7);assert.equal(command.accountId,3);
assert.equal(command.peerGuid,8);assert.equal(command.peerAccountId,4);
assert.ok(command.expiresAt>Date.now()/1000);
});