const assert = require('assert'); const fs = require('fs'); const path = require('path'); const profileHtml = fs.readFileSync(path.join(__dirname, '..', 'profile.html'), 'utf8'); const profileCommon = fs.readFileSync(path.join(__dirname, '..', 'public', 'js', 'profile-common.js'), 'utf8'); assert.match(profileHtml, /data-logout-confirm/); assert.match(profileHtml, //); assert.match(profileHtml, /退出登录<\/span>返回首页<\/b>/); assert.match(profileCommon, /function performLogout\(targetUrl\)/); assert.match(profileCommon, /api\.logout\(\)/); assert.match(profileCommon, /targetUrl \|\| 'index\.html'/); console.log('profile logout structure tests passed');