const assert = require("node:assert/strict"); const fs = require("node:fs"); const path = require("node:path"); const test = require("node:test"); const sourcePath = path.resolve(__dirname, "../src/views/channel/index.vue"); const guidePath = path.resolve( __dirname, "../../dianshang-houduan/src/main/resources/static/file/training-materials/purchase-demand-forecast/18.实训操作说明.docx" ); test("采购需求预测实训操作说明由后端内置 Word 文件提供下载", () => { const source = fs.readFileSync(sourcePath, "utf8"); assert.ok(fs.existsSync(guidePath), "后端应提供采购需求预测实训操作说明 Word 文件"); assert.match(source, /\/file\/training-materials\/purchase-demand-forecast\/18\.实训操作说明\.docx/); assert.match( source, /function downloadPracticeGuide\(\) \{\s*downloadBuiltInFile\(PURCHASE_DEMAND_FORECAST_GUIDE_URL, "18\.实训操作说明\.docx"\);\s*\}/ ); });