import assert from 'node:assert/strict' import { readFile } from 'node:fs/promises' import { fileURLToPath } from 'node:url' import path from 'node:path' import { parse as parseSfc } from '@vue/compiler-sfc' const scriptDir = path.dirname(fileURLToPath(import.meta.url)) const viewPath = path.resolve(scriptDir, '../src/views/model/ModelManageView.vue') const source = await readFile(viewPath, 'utf8') const { descriptor, errors } = parseSfc(source, { filename: viewPath }) assert.equal(errors.length, 0, `模型管理页面模板无法解析:${errors[0]}`) assert.ok(descriptor.template?.content.trim(), '模型管理页面缺少可渲染模板') assert.equal((source.match(/