收紧移动壳外链与扫码边界
移动壳外链原生异常改由壳层记录日志 移动扫码请求使用共享超时自动清理 pending 状态 原生壳结构门禁补充期望清单唯一性自检 项目记忆同步移动壳边界验收约定
This commit is contained in:
@@ -866,6 +866,20 @@ function assertSameList(actual, expected, label) {
|
||||
}
|
||||
}
|
||||
|
||||
function assertUniqueList(values, label) {
|
||||
const seen = new Set();
|
||||
const duplicates = values.filter((value) => {
|
||||
if (seen.has(value)) {
|
||||
return true;
|
||||
}
|
||||
seen.add(value);
|
||||
return false;
|
||||
});
|
||||
if (duplicates.length > 0) {
|
||||
throw new Error(`${label} must not contain duplicate entries: ${duplicates.join(', ')}`);
|
||||
}
|
||||
}
|
||||
|
||||
function assertSameSet(actual, expected, label) {
|
||||
const sortedActual = [...actual].sort();
|
||||
const sortedExpected = [...expected].sort();
|
||||
@@ -2186,6 +2200,24 @@ function assertWechatShareGridFailureBoundaries() {
|
||||
}
|
||||
|
||||
function assertHostBridgeLayerLayout() {
|
||||
for (const [label, values] of [
|
||||
['wechat host bridge files expectation', expectedWechatHostBridgeFiles],
|
||||
['wechat shell files expectation', expectedWechatShellFiles],
|
||||
['wechat page routes expectation', Object.keys(expectedWechatPageFilesByRoute)],
|
||||
['mobile host bridge files expectation', expectedMobileHostBridgeFiles],
|
||||
['mobile shell src root entries expectation', expectedMobileSrcRootEntries],
|
||||
['mobile shell files expectation', expectedMobileShellFiles],
|
||||
['desktop host bridge Rust files expectation', expectedDesktopHostBridgeRustFiles],
|
||||
['desktop shell Rust files expectation', expectedDesktopShellRustFiles],
|
||||
]) {
|
||||
assertUniqueList(values, label);
|
||||
}
|
||||
for (const [route, expectedFiles] of Object.entries(
|
||||
expectedWechatPageFilesByRoute,
|
||||
)) {
|
||||
assertUniqueList(expectedFiles, `wechat ${route} page wrapper files expectation`);
|
||||
}
|
||||
|
||||
assertSameList(
|
||||
readDirectoryFileList(
|
||||
'miniprogram/host-bridge',
|
||||
|
||||
Reference in New Issue
Block a user