const assert = require('node:assert/strict') const fs = require('node:fs') const path = require('node:path') const root = path.resolve(__dirname, '..') const tabLayout = fs.readFileSync(path.join(root, 'src/layouts/TabLayout.vue'), 'utf8') const pageLayout = fs.readFileSync(path.join(root, 'src/layouts/PageLayout.vue'), 'utf8') const home = fs.readFileSync(path.join(root, 'src/pages/home/HomePage.vue'), 'utf8') assert.match(tabLayout, /to="\/messages"[^>]*>消息<\/van-tabbar-item>/) assert.match(pageLayout, /class="page-layout__nav"/) assert.match(home, /home-hero-v2\.jpg/) assert.doesNotMatch(home, /home__banner-cover[^\n]*\{\{ \(b\.title \|\| '善'\)\.slice\(0, 1\) \}\}/) console.log('PASS: H5 UI contract')