const assert = require("assert"); const fs = require("fs"); const path = require("path"); const componentPath = path.resolve( __dirname, "../../src/views/ccdiCreditInfo/index.vue" ); const detailComponentPath = path.resolve( __dirname, "../../src/views/ccdiCreditInfo/components/CreditInfoDetail.vue" ); const source = fs.readFileSync(componentPath, "utf8"); assert(fs.existsSync(detailComponentPath), "征信详情展示组件未抽取"); const detailSource = fs.readFileSync(detailComponentPath, "utf8"); [ "CreditInfoDetail", " { assert(source.includes(token), `详情或删除交互缺少关键结构: ${token}`); }); [ 'name: "CreditInfoDetail"', "征信摘要", "负债信息", "负面信息", "detail.debtCount", "detail.debtTotalAmount", "detail.negativeInfo.civilCnt", "detail.negativeInfo.enforceCnt", "detail.negativeInfo.admCnt", "detail.debts || []", ].forEach((token) => { assert(detailSource.includes(token), `征信详情组件缺少关键结构: ${token}`); }); console.log("credit-info-detail-ui test passed");